Run a marco on sheet3, then sheet4....sheet99

jonh

New Member
Joined
Mar 2, 2005
Messages
42
Hi,

Is it possible to create a macro that runs another macro in sheet3, then moves on to sheet4 and run the same macro, sheet5 etc. etc.

This is further complicated by the fact that each tab is 'named' i.e. Summary, North, South, East, West, Sales Consultant North1, Sales Consultant North2... etc. I want the macro to run in "Sales Consultant Sheets" but not in the Sumarry Sheets i.e. North, South, East and West.

All the sales consultant sheets are adjacent to one another, but occassionally, sales consultants sheets are added (new additions) and deleted (sales person leaves the org).

Thanks in advance of any help...
Jon
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try this .....
Code:
Sub temp()
For i = 1 To Application.ActiveWorkbook.Sheets.Count
    If Application.ActiveWorkbook.Sheets.Item(i).Name <> "Sheet1" AND _
       Application.ActiveWorkbook.Sheets.Item(i).Name <> "Sheet2" AND _
       Application.ActiveWorkbook.Sheets.Item(i).Name <> "Sheet3"  Then

     Then
       Application.ActiveWorkbook.Sheets.Item(i).Activate
       Call mymacro
    End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,972
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top