Batigoal80
Gebruiker
- Lid geworden
- 4 dec 2007
- Berichten
- 52
Code:
Sub opvragengrafiek()
Dim i As Range
Dim sFindKPI As String
Dim rngData As Range
Dim wsinvoer As String
Dim wsgraf As String
Dim wsdata As String
Dim lngcolumn As Long
Dim wsdoel As String
Dim Msg, style, title, response, mystring
Application.ScreenUpdating = False
Msg = "Is de juiste KPI ingevuld?"
style = vbYesNo
title = "Pas op!"
response = MsgBox(Msg, style, title)
If response = vbNo Then End
wsinvoer = "Grafiek_opvragen"
wsdata = "database"
wsdoel = "doelstellingen"
wsgraf = "grafiek gegevens"
sFindKPI = Sheets(wsinvoer).Range("b3").Value
Sheets(wsdata).Range("A:BP").EntireColumn.Hidden = False
For Each i In Sheets(wsdata).Range("c1:bo1")
If i = sFindKPI Then
i.EntireColumn.Copy
Sheets(wsgraf).Select
[COLOR="Red"]Columns("B:B").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False[/COLOR]
End If
Next
In het rode gedeelte krijg ik bovenstaande fout (zie titel)
Hierbij geeft hij "Door de toepassing of door object gedefinieerde fout"
Ik hoop dat iemand mij kan helpen!
Groet Wouter