First, the "Option Explicit" lines belongs outside your procedure--at the top of
the module.
Second you have a couple of routines jumbled up into one.
Maybe...
Option Explicit
Sub testme01()
Worksheets("Alpha").ShowDataForm
End Sub
Sub Pricelookup()
With Worksheets(1).Range("a2:a3000")
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
But it looks like that "Pricelookup" procedure was an experiment that is just
left over. In fact, it looks like it was copied and pasted from VBA's help.
I think I'd delete that routine and just use the top stuff:
Option Explicit
Sub testme01()
Worksheets("Alpha").ShowDataForm
End Sub
Rick said:
My Macro is written:
Sub Pricelookup()
Option Explicit
Sub testme01()
Worksheets("Alpha").ShowDataForm
End Sub
When macro stops and I get error message, this is what is on the screen:
With Worksheets(1).Range("a2:a3000")
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
Again, thanks for the help, I know almost nothing about VBA.
Rick