I have 4 macros that create 4 reports. I have a 5th macro that runs all 4 macros so creates all 4 reports if I need them all.
All macros have a message box pop up to day they're complete. Of course this means the 5th "all reports" macro has 4 "I'm complete" message boxes".
I really only want one message box to appear for the "all reports" macro. Is there a clever way to suppress the 4 individual messages boxes?
If we could run more than one macro per button than it would be easy but of course we can't.
Why don't you use Excel's statusbar instead ?
One way:
Sub Macro1(Optional blnShowMessage As Boolean = True) MsgBox "Running Macro 1" If blnShowMessage Then MsgBox "Macro 1 has completed" End If End Sub Sub Macro2(Optional blnShowMessage As Boolean = True) MsgBox "Running Macro 2" If blnShowMessage Then MsgBox "Macro 2 has completed" End If End Sub Sub Run_All_With_Message() Call Macro1 Call Macro2 End Sub Sub Run_All_Without_Message() Call Macro1(False) Call Macro2(False) End Sub
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
or
Sub tst1() Application.DisplayAlerts = False tst2 tst3 End Sub Sub tst2() If Application.DisplayAlerts Then MsgBox "DisplayAlerts = true" End Sub Sub tst3() If Application.DisplayAlerts Then MsgBox "DisplayAlerts = true" End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks