I got this example straight from the Microsoft site, it's the first example on how to use the find method. The problem is it gives error 91: object variable or with block variable not set. It's supposed to find where a cell has a value of 2 and change it to 5 and it does that if there are any "2"s in the range but then it also gives the error when it's done. What am I doing wrong?
Sub example()
With Worksheets(1).Range("a1:a10")
Set c = .Find(2, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub