ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MsgBox Help! (https://www.excelbanter.com/excel-programming/283117-msgbox-help.html)

rbanks

MsgBox Help!
 

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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Nicke[_4_]

MsgBox Help!
 
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
-----Original Message-----

Hi,

I consider myself an Excel formula expert, but only

slightly above the
novice level in VBA macros. Here's my problem.

I have a workbook where I've written about 30 different

retrieve macros
(Hyperion Essbase) to update data in different sections

of the file.
At the end of each macro I have a msgbox that basicall

says "data
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 in
a specific order. I don't want the user to have to

click OK 30 times
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 individual
macro and it would work, but I'd really like to keep

them their.


Any suggestions?

Thanks:confused:


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.


Richard Banks

MsgBox Help!
 
"Nicke" wrote in message ...
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
-----Original Message-----

Hi,

I consider myself an Excel formula expert, but only

slightly above the
novice level in VBA macros. Here's my problem.

I have a workbook where I've written about 30 different

retrieve macros
(Hyperion Essbase) to update data in different sections

of the file.
At the end of each macro I have a msgbox that basicall

says "data
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 in
a specific order. I don't want the user to have to

click OK 30 times
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 individual
macro and it would work, but I'd really like to keep

them their.


Any suggestions?

Thanks:confused:


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

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
msgbox "Updated!"
End If



thanks

.


Tom Ogilvy

MsgBox Help!
 
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


--
Regards,
Tom Ogilvy



Richard Banks wrote in message
m...
"Nicke" wrote in message

...
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
-----Original Message-----

Hi,

I consider myself an Excel formula expert, but only

slightly above the
novice level in VBA macros. Here's my problem.

I have a workbook where I've written about 30 different

retrieve macros
(Hyperion Essbase) to update data in different sections

of the file.
At the end of each macro I have a msgbox that basicall

says "data
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 in
a specific order. I don't want the user to have to

click OK 30 times
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 individual
macro and it would work, but I'd really like to keep

them their.


Any suggestions?

Thanks:confused:


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

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
msgbox "Updated!"
End If



thanks

.




rbanks[_7_]

MsgBox Help!
 

Thanks Tom,

I works like a charm

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com