Make macro run on all worksheets except the first

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to write an auto run macro that runs on each worksheet in the
workbook except the first upon opening. I am using

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 29/05/2007 by Kirsty Liddicoat
'

Dim ws As Worksheet
For Each ws In Worksheets(Array(2, 3, 4, 5, 6))
'macro action
Next ws

End Sub

being what I am trying to achieve. This is working but the macro is only
running on the sheet it opens up on not all of the worksheets.

Any suggestions?
 
Tiger
The macro you have, as written, will always work on the active sheet.
Nothing in your macro changes the active sheet. Add the following line
before "'macro action:
ws.select
HTH Otto
 
Back
Top