Fout 91:Object variabele of blokvariabele with is niet ingesteld

Status
Niet open voor verdere reacties.

Dirks

Gebruiker
Lid geworden
27 nov 2002
Berichten
8
Ik heb de volgende macro gemaakt. In Excel 2003 werkt het wel maar in Excel 2000 krijg ik de volgende fout:
Fout 91 tijdens uitvoering:
Object variabele of blokvariabele with is niet ingesteld

Wat doe ik niet goed?

Sub Controleren()

Dim ZoekWaarde As String

ZoekWaarde = ActiveCell

Selection.Copy
Cells.Find(What:=ZoekWaarde, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

end sub
 
Ik weet niet wat je eigenlijk wilt doen, maar dit werkt wel:

Code:
Sub Controleren()
    ActiveCell.Copy
    Cells.Find(What:=ActiveCell.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, SearchFormat:=False).Activate
End Sub

Code ook ingekort.

Wigi
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan