tlc53
Active Member
- Joined
- Jul 26, 2018
- Messages
- 399
Hi,
I've finally got everything working how I need it to (thanks to the people on here!) and now I'm at the last hurdle.
From my Dashboard sheet, I then want to select each sheet and run the necessary macro. Once done, it takes me back to the Dashboard.
The problem with my code below, is that if refers to Workbook name 'Invoice Converter - Template'. I really need it not to, as the sheet will be renamed each month and this will stop the macro working.
How do I get around this/run the macros on each sheet? Thank you.
I've finally got everything working how I need it to (thanks to the people on here!) and now I'm at the last hurdle.
From my Dashboard sheet, I then want to select each sheet and run the necessary macro. Once done, it takes me back to the Dashboard.
The problem with my code below, is that if refers to Workbook name 'Invoice Converter - Template'. I really need it not to, as the sheet will be renamed each month and this will stop the macro working.
How do I get around this/run the macros on each sheet? Thank you.
Code:
Sub ApplyAll()
'
' ApplyAll Macro
'
'
Sheets("Monthly Data").Select
Application.Run "'Invoice Converter - Template.xlsm'!CleanUp"
Sheets("Cordis").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("Hilton Banquets").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("Hilton Cluster").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("FourPoints").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("Hilton Guest").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("Pullman").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("Sebel Manukau").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
Sheets("Stamford Plaza").Select
Application.Run "'Invoice Converter - Template.xlsm'!ClientNarrative"
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets("Dashboard").Select
CommandButton1.Enabled = False
End Sub