PC Review


Reply
Thread Tools Rate Thread

Activate each sheet in workbook with exception of...

 
 
Jazz
Guest
Posts: n/a
 
      7th Oct 2009
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 With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      7th Oct 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activate sheet in another workbook by its code name AshMorK Microsoft Excel Programming 2 27th Sep 2008 04:21 AM
WorkBook Open & Sheet Activate jimmy Microsoft Excel Programming 1 8th May 2007 06:26 PM
Run a sheet's activate code when entering it's workbook mikeburg Microsoft Excel Programming 2 3rd Dec 2005 05:50 AM
Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate Jack Gillis Microsoft Excel Discussion 2 21st Mar 2005 11:58 PM
Re: how to open a Workbook and activate a specific sheet Bigwheel Microsoft Excel Programming 0 17th Aug 2004 09:04 PM


Features
 

Advertising
 

Newsgroups
 


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