shg
MrExcel MVP
- Joined
- May 7, 2008
- Messages
- 21,836
- Office Version
- 2010
- Platform
- Windows
I have a workbook where various sheets get published based on various criteria. For each sheet to be published, I want to run a short macro (that takes no arguments) behind each sheet. Depending on the sheet, it may autofilter a table, or set the zoom, or do nothing at all. This doesn't work:
What have I forgotten?
Thanks in advance.
VBA Code:
Sub x()
Dim wks As Worksheet
For Each wks In Worksheets
If isGonnaGetPublished(wks) Then
Application.Run wks.CodeName & ".BeforePublish"
End If
Next wks
' other stuff
End Sub
What have I forgotten?
Thanks in advance.