Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveSheet.Next with hidden sheets
Hello,
I currently have a spreadsheet that has a 'veryhidden' sheet. I have written a macro to navigate foward and backwards throughout the spreadsheet, however, when it gets to the hidden sheets location, the macro will not skip over it. Macro: ActiveSheet.Next.Select Even when I use the macro recorder, the code is as per above?!?! I have found that the error is: 1004, 'Select method of worksheet class failed'. I have managed to use the errorhandler to move past this by calling the next sheet by name, but fear this sheetname may get changed in the future.... is there anyway of retrieving the sheet index number? Thanks, KK |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveSheet.Next with hidden sheets
Try this
On Error Resume Next ActiveSheet.Next.Select Do While Err.Number < 0 Err.Clear Worksheets(ActiveSheet.Index + 2).Select Loop On Error Goto 0 -- --- HTH Bob (change the xxxx to gmail if mailing direct) "KurviousKoala" wrote in message ... Hello, I currently have a spreadsheet that has a 'veryhidden' sheet. I have written a macro to navigate foward and backwards throughout the spreadsheet, however, when it gets to the hidden sheets location, the macro will not skip over it. Macro: ActiveSheet.Next.Select Even when I use the macro recorder, the code is as per above?!?! I have found that the error is: 1004, 'Select method of worksheet class failed'. I have managed to use the errorhandler to move past this by calling the next sheet by name, but fear this sheetname may get changed in the future.... is there anyway of retrieving the sheet index number? Thanks, KK |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
hidden sheets | Excel Discussion (Misc queries) | |||
Copying new activesheet after other activesheet is hidden? | Excel Programming | |||
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets | Excel Programming | |||
Hidden sheets | Excel Programming | |||
ActiveSheet.ShowAllData shows everything - way to have hidden _not_ show up? | Excel Programming |