Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I've tried various formats of array contents in sheets(array).select, and
always get a subscript out of range error. I've used (1, 2, 3), ("sheet1", "sheet2", "sheet3"), and others. I DO have multiple sheets, and have verified that the ones in the array actually exist. My current code: Dim mySheet As Worksheet For Each mySheet In ActiveWorkbook.Sheets Worksheets(mySheet.Name).Activate If ActiveSheet.Tab.ColorIndex = 3 Then 'this is a red tab worksheet If sheetlist = "" Then sheetlist = mySheet.Index Else sheetlist = sheetlist & ", " & mySheet.Index End If End If Next Sheets(sheetlist).Select End Sub Sheetlist contents when it crashes on select statement: 31, 32, 33, 36 But it crashes if I change the code so that sheetlist contents a "sheet31, "sheet32", "sheet33", "sheet36" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem using newly created user function in Excel 2003 | Excel Discussion (Misc queries) | |||
have some problem with database | Excel Discussion (Misc queries) | |||
Urgent Help Required on Excel Macro Problem | Excel Discussion (Misc queries) | |||
Problem With Reference Update | Excel Worksheet Functions | |||
Freeze Pane problem in shared workbooks | Excel Discussion (Misc queries) |