Thread: Error 91
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Error 91

Hi
Try
cl = Activecell.Value

regards
Paul

as cl is a range object.
DaveyJones wrote:
I'm using this code to search for a certain 5 digit number eg 88860

Dim cl As Long
Sheets("Milestone").Select
Range("C2").Select
cl = ActiveCell 'Set cl as number 88860
Sheets("Master").Select
Range("A4").Select
Cells.find(What:=cl, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

and an error comes up at this point saying something like I have not set the
variable. I've used this code loads iof times before with no problem, so I
don't know whats up. Any help?


--
Dave