MsgBox Help!

  • Thread starter Thread starter rbanks
  • Start date Start date
R

rbanks

Hi,

I consider myself an Excel formula expert, but only slightly above th
novice level in VBA macros. Here's my problem.

I have a workbook where I've written about 30 different retrieve macro
(Hyperion Essbase) to update data in different sections of the file.
At the end of each macro I have a msgbox that basicall says "dat
updated". This is fine for running the macros individually.

I'm now writing a macro that will call and run all of the other ones i
a specific order. I don't want the user to have to click OK 30 time
in order for the macro to continue.

Is there a way to make it automatically clear each box and continue.
Obviously I could take the msgboxs off of the end of each individua
macro and it would work, but I'd really like to keep them their.


Any suggestions?

Thanks:confused
 
Hi,

It think you'll have to pass a parameter to every macro
that tells the macro what to do. You could make the
parameter Optional, i.e.

Public Sub MySub(Optional ShowMsg as boolean = True)
'In this case ShowMsg = True if no parameter was given
'Your code...

If ShowMsg Then
msgbox "Updated!"
End If


End Sub

Hope this help!

/Nicke
 
Nicke said:
Hi,

It think you'll have to pass a parameter to every macro
that tells the macro what to do. You could make the
parameter Optional, i.e.

Public Sub MySub(Optional ShowMsg as boolean = True)
'In this case ShowMsg = True if no parameter was given
'Your code...

If ShowMsg Then
msgbox "Updated!"
End If


End Sub

Hope this help!

/Nicke
http://www.ExcelForum.com/

Nicke,

I don't understand. (Remember that I'm a novice). Should I enter the code:

Public Sub MySub(Optional ShowMsg as boolean = True)
within the text of my call macro, or within each of the individual macros.

Same question for the :

If ShowMsg Then
 
At the top of your module put in

Public bNotOK As Boolean

' run if you want to show msgboxes and they
' are not showing
Sub bNotOkFalse()
bNotOK = False
End Sub


Sub Process30()
bNotOK = True
Macro1
Macro2
' . . .
' macro30
bNotOK = False
End Sub

Sub Macro1()
' code

If Not bNotOK Then
MsgBox "Done with Macro1"
End If
End Sub

Sub Macro2()

'
If Not bNotOK Then
MsgBox "Done with Macro2"
End If
End Sub
 
Back
Top