Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2002, WinXP
I have the following code within a loop. On Error Resume Next Sht = ClientList.Find(What:=............. On Error GoTo 0 If Sht Is Nothing Then................. My problem is that, because this in a loop, the variable "Sht" will retain its previous value if the Find statement cannot find the search item. Therefore, the "If Sht Is Nothing Then....." statement will not do what I want. My question is: What can I set as the value of Sht, before the above code, to have the "If" statement react as I want? Sht = Nothing doesn't do it. Or a more general question: How can I determine that the Find statement found nothing? I know that I can use "On Error GoTo Somewhere" but is there a better way? Thanks for your help. Otto |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
Cells.Find error Object variable or With block variable not set | Excel Programming | |||
Pivot Table - Object variable or with block variable not set? | Excel Programming |