LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Subscript Out Of Range Error Message

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error:Subscript out of range Jay Excel Discussion (Misc queries) 1 April 10th 08 10:25 PM
Error Message "Subscript our of range" gsmclang Excel Discussion (Misc queries) 1 April 5th 07 06:59 PM
Subscript out of range error Tom Ogilvy Excel Programming 0 December 10th 03 12:48 AM
Help on subscript out of range error (VB6/VBA) farmer[_2_] Excel Programming 2 November 2nd 03 04:19 PM
Subscript out of range error Gary[_4_] Excel Programming 1 August 13th 03 07:20 AM


All times are GMT +1. The time now is 03:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"