Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
At least one of those sheets does not exist as spelled.
If you can't spot it, try this: On error resume next For i=1 to 12 ws=Sheets(Array("Rationale11", "Rationale12", "Rationale13", "Rationale21", "Rationale22", "Rationale23", "Rationale31", "Rationale32", "Rationale33", "Rationale41", "Rationale42", "Rationale43")(i+1) err.clear worksheets(Ws).activate if err.number0 then msgbox ws & " doesn't exist" Next Bob Umlas "Phil Hageman" wrote in message ... When I open this workbook, I get an error message (Run-time error '9': Subscript out of range.) on the following line of code: For Each WS In ThisWorkbook.Sheets(Array("Rationale11", "Rationale12", "Rationale13", "Rationale21", "Rationale22", "Rationale23", "Rationale31", "Rationale32", "Rationale33", "Rationale41", "Rationale42", "Rationale43")) Can someone suggest a fix? Thanks, Phil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
Error Message "Subscript our of range" | Excel Discussion (Misc queries) | |||
Subscript out of range error | Excel Programming | |||
Help on subscript out of range error (VB6/VBA) | Excel Programming | |||
Subscript out of range error | Excel Programming |