Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had to add the IF statement below to stop the Loop if MyValue wasn't found
on any of the sheets. Is there any better way to do the following, or since this seems to work, just leave it alone? workbook has only 8 sheets. Thanks. the code: MyValue = PO_Number Dim MyVar On Error Resume Next a = 1 Do While MyVar = "" MyVar = Application.WorksheetFunction _ .Match(MyValue, Worksheets(a).Range("E1:E3000"), 0) a = a + 1 If a = 8 And MyVar = "" Then MsgBox ("PO # Not Found In Records.") Exit Sub End If Loop ' Select sheet and cell after finding Sheets(Worksheets(a - 1).Name).Select Range("E" & MyVar).Select |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Endless spreadsheet calculations | Excel Discussion (Misc queries) | |||
How can I make endless row, beyond IV column? | New Users to Excel | |||
preventing endless loops | Excel Programming | |||
Endless loop? | Excel Programming | |||
Interrupting an endless loop | Excel Programming |