LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default ActiveNext

As I said, the above code stops the indexing at the last sheet. If, after
you reach the last sheet, you wanted to wrap back around to the first
sheet, give this a try...

Worksheets(ActiveSheet.Index + 1 + Worksheets.Count * _
(ActiveSheet.Index + 1 Worksheets.Count)).Activate


And if you need code to move to the Previous sheet where, if the ActiveSheet
is the first one, it wraps back around to the last sheet, this code will do
that...

Worksheets(ActiveSheet.Index - 1 - Worksheets.Count * _
(ActiveSheet.Index = 1)).Activate

Rick

 
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



All times are GMT +1. The time now is 02:10 PM.

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"