MACRO AND MULTIPLE WORKSHEETS
Sub Work_on_Selected_Sheets()
Dim ws as WorkSheet
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
'your code here
Next ws
End Sub
Gord Dibben MS Excel MVP
On Mon, 15 Jan 2007 12:40:02 -0800, Mel wrote:
I created a macro that I want to apply to multiple worksheets in a book.
When I click on one worksheet the macro runs successfully, when I selelct
multiple worksheets by selecting a tab and holding the shift key, the macro
does not work? Is there a certain way to select the worksheets in order for
the macro to work?
Thanks.
|