The following code is intended to execute a macro on multiple worksheets. It is only working on the active sheet. Can anyone tell me how to get it to execute on subsequent worksheets? I am a newbie...
Sub Essbase2()
'==========================================================
'Refresh all Essbase queries in file
'==========================================================
Dim hCtx As Long
Dim ws As Worksheet
Application.Wait Now + TimeValue("00:00:01")
Application.ScreenUpdating = False
For Each ws In Worksheets
'Exclude specific sheets
If ws.Name <> "Sheet1" And ws.Name <> "Sheet3" Then
With ws
Range("a1:s560").Select
Application.Run macro:="EssMenuRetrieve"
End With
End If
Next ws
Application.ScreenUpdating = True
End Sub
Bookmarks