Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a function that uses the find method to search for
a string within a spreadsheet. It works fine when called, except when I call it from a For loop I get a RunTime erro 91: Object variable or with block variable not set. Does anybody know why I keep getting this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As always, copy/paste your code here. Do NOT send workbook.
-- Don Guillett SalesAid Software "Slugo" wrote in message ... I have a function that uses the find method to search for a string within a spreadsheet. It works fine when called, except when I call it from a For loop I get a RunTime erro 91: Object variable or with block variable not set. Does anybody know why I keep getting this? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I suspect you have a construct like
cells.Find("target").Select if the target is not found, cells.find resolves to nothing so you have nothing.Select which raises that error. You should do set rng = cells.find("target") if not rng is nothing then rng.select Else msgbox "Target not found" End if Regards, Tom Ogilvy "Slugo" wrote in message ... I have a function that uses the find method to search for a string within a spreadsheet. It works fine when called, except when I call it from a For loop I get a RunTime erro 91: Object variable or with block variable not set. Does anybody know why I keep getting this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
BreakLinks method doesn't work. | Excel Discussion (Misc queries) | |||
find method? | Excel Programming | |||
The find method | Excel Programming | |||
Help with the Find method | Excel Programming | |||
Making VB PasteSpecial method to work the same as Excels Application | Excel Programming |