Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Activate each sheet in workbook with exception of...

I am trying to activate each Sheet in the workbook one time, with the
exception of 3 Sheets? Call them Sheet2, Wk3, and DD4. Do you know how to
do that?

Sub NextSheet()

If ActiveSheet.Index = Sheets.Count Then
Sheets(1).Activate
Else
Sheets(ActiveSheet.Index + 1).Activate
End If

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Activate each sheet in workbook with exception of...

Hi,

Try this

Sub NextSheet()
For x = 1 To Worksheets.Count
S = "Sheet2,Wk3,DD4"
V = Split(S, ",")
If Not IsError(Application.Match((Sheets(x).Name), V, 0)) Then
Sheets(x).Activate
'presumably do things
End If
Next

End Sub
Mike

"Jazz" wrote:

I am trying to activate each Sheet in the workbook one time, with the
exception of 3 Sheets? Call them Sheet2, Wk3, and DD4. Do you know how to
do that?

Sub NextSheet()

If ActiveSheet.Index = Sheets.Count Then
Sheets(1).Activate
Else
Sheets(ActiveSheet.Index + 1).Activate
End If

End Sub

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
Activate sheet in another workbook by its code name AshMorK Excel Programming 2 September 27th 08 04:21 AM
WorkBook Open & Sheet Activate jimmy[_5_] Excel Programming 1 May 8th 07 06:26 PM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
how to open a Workbook and activate a specific sheet Bob Phillips[_6_] Excel Programming 0 August 17th 04 09:24 PM
how to open a Workbook and activate a specific sheet Bigwheel Excel Programming 0 August 17th 04 09:04 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"