#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default ActiveNext

ActiveWindow.ActivateNext ----Is there a ActiveSheet.ActivateNext


--
Esau
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default ActiveNext

ActiveWindow.ActivateNext ----Is there a ActiveSheet.ActivateNext

You could always use something like this (it stops at the last sheet)...

Worksheets(ActiveSheet.Index-(ActiveSheet.Index<Worksheets.Count)).Activate

Rick
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default ActiveNext

Not really. By using the worksheet index number you can activate the next
sheet tab to the right.

Worksheets(ActiveSheet.Index + 1).Activate

Mike F
"Esau" wrote in message
...
ActiveWindow.ActivateNext ----Is there a ActiveSheet.ActivateNext


--
Esau



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default ActiveNext

Rick's reply is more accurate whereas mine would error out on the last
sheet.

Mike F
"Mike Fogleman" wrote in message
...
Not really. By using the worksheet index number you can activate the next
sheet tab to the right.

Worksheets(ActiveSheet.Index + 1).Activate

Mike F
"Esau" wrote in message
...
ActiveWindow.ActivateNext ----Is there a ActiveSheet.ActivateNext


--
Esau





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default ActiveNext

You can use

ActiveSheet.Next.Select

ActiveSheet.Previous.Select

But test where you are because it blow if you you are in the last/first sheet


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Esau" wrote in message ...
ActiveWindow.ActivateNext ----Is there a ActiveSheet.ActivateNext


--
Esau



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default ActiveNext

ActiveWindow.ActivateNext ----Is there a ActiveSheet.ActivateNext

You could always use something like this (it stops at the last sheet)...

Worksheets(ActiveSheet.Index-(ActiveSheet.Index<Worksheets.Count)).Activate


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


Rick

  #7   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

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



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