Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default skip hidden sheets

I have a workbook with about 50 sheets. I have a decision tree that
unhides sheets based on the answers to screening questions. I want to
add navigation buttons to allow users to go to the next or previous
sheets. When the next sheet is hidden the macro hangs. How can move
to the next unhidden sheet?

I've tried:

activesheet.next.select

which didn't work.

Any thoughts?

thanks in advance,

Dave

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default skip hidden sheets


Dim sh as Object
if Activesheet.Index < Sheets.count then
set sh = activesheet.Next

do while sh.visible < xlSheetVisible and sh.Index < sheets.count
set sh = sh.Next
Loop
if sh.visible = xlSheetVisible then
sh.Activate
else
msgbox "Nothing to do"
end if

--
Regards,
Tom Ogilvy


"savalou" wrote in message
ups.com...
I have a workbook with about 50 sheets. I have a decision tree that
unhides sheets based on the answers to screening questions. I want to
add navigation buttons to allow users to go to the next or previous
sheets. When the next sheet is hidden the macro hangs. How can move
to the next unhidden sheet?

I've tried:

activesheet.next.select

which didn't work.

Any thoughts?

thanks in advance,

Dave



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default skip hidden sheets

Left off the last end if

Dim sh as Object
if Activesheet.Index < Sheets.count then
set sh = activesheet.Next

do while sh.visible < xlSheetVisible and sh.Index < sheets.count
set sh = sh.Next
Loop
if sh.visible = xlSheetVisible then
sh.Activate
else
msgbox "Nothing to do"
end if
Else
msgbox "Your at the last"
End if

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...

Dim sh as Object
if Activesheet.Index < Sheets.count then
set sh = activesheet.Next

do while sh.visible < xlSheetVisible and sh.Index < sheets.count
set sh = sh.Next
Loop
if sh.visible = xlSheetVisible then
sh.Activate
else
msgbox "Nothing to do"
end if

--
Regards,
Tom Ogilvy


"savalou" wrote in message
ups.com...
I have a workbook with about 50 sheets. I have a decision tree that
unhides sheets based on the answers to screening questions. I want to
add navigation buttons to allow users to go to the next or previous
sheets. When the next sheet is hidden the macro hangs. How can move
to the next unhidden sheet?

I've tried:

activesheet.next.select

which didn't work.

Any thoughts?

thanks in advance,

Dave





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default skip hidden sheets

that's great. Thanks very much.

Dave

Reply
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
Skip Rows in Fill Series and Filter to Two different sheets Benjamin Excel Worksheet Functions 3 June 30th 09 12:58 AM
Skip hidden rows while copying down in excel? DRSTCSPM Excel Discussion (Misc queries) 2 September 20th 06 07:32 PM
How do I copy information and skip hidden cells? unfrgvn82 Excel Discussion (Misc queries) 3 February 25th 06 12:09 AM
Sheets Skip Macro NICK Excel Discussion (Misc queries) 2 February 11th 05 07:16 AM
skip empty sheets Rob Excel Programming 2 February 6th 05 01:48 PM


All times are GMT +1. The time now is 05:08 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"