Thread: VB macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gerrit Van Stempvoort Gerrit Van Stempvoort is offline
external usenet poster
 
Posts: 1
Default VB macro


I made a VB macro for excel. I recorded the following "Find" function
and copied it into the macro:

Cells.Find(What:="Time", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate

When I run the macro I got an error message:
"Error 91
Objectvariable or blockvariable With not defined."

When I replace "LookAt:=xlWhole" by "LookAt:=xlPart", then the macro
runs well, but will find the wrong cell.
What's wrong?
I don't use any "With" function in the macro.

Thanks beforehand for your help.


*** Sent via Developersdex http://www.developersdex.com ***