View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default selection.find help!

First if not already implemented put

Option Explicit

at the very top of your module.
Compile your project and make sure that every variable is declared. May be
that you have mistyped the name of a variable at some point and it doesn't
know what it is.

Second, if your Selection spans multiple worksheets then this might be
causing your problem, or if your find returns multiple worksheets, that too
could be the problem. I.e., how does the system activate multiple
worksheets? I don't know, never tried, never seen that happen. Might also
fix the problem if you use 'Call' at the beginning of the code line.


"Duncan" wrote:

Hi all,

My code used to work when i only had one sheet in the workbook, it done
Selection.Find(What:=Interiminput.regint.Value, LookIn:=xlValues,
SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False).Activate

now that i have added more sheets it comes up with "object variable or
with block variable not set" when it gets to the code.

This must be real simple but I am banging my head against the wall!

any ideas?

Duncan