![]() |
Macro Message Box
Hi, I am trying to build a macro for a histogram. When the macro is complete,
I am asked "Histogram - Some data will be hidden by embedded chart(s)." I can click OK or cancel. How can I build my OK response into the macro so that I do not need to manually respond? Thank you for reviewing my question. |
Macro Message Box
Remove the MsgBox from the macro if it is unnecessary.
-- HTH Bob "lahuwm" wrote in message ... Hi, I am trying to build a macro for a histogram. When the macro is complete, I am asked "Histogram - Some data will be hidden by embedded chart(s)." I can click OK or cancel. How can I build my OK response into the macro so that I do not need to manually respond? Thank you for reviewing my question. |
Macro Message Box
Hi,
AFAIK message boxes are modal so you can't do that but you can do it with a userform. Create a userform and put a text box on it and include this line in you code at the appropriate point. Note the declaration of Mytext as Public Public MyText As String Sub YourSub() 'Your Code MyText = "An informative message" UserForm1.Show End Sub Attach this code to the userform and it will display your message and close after 10 seconds. Private Sub UserForm_Activate() TextBox1.Text = MyText Application.Wait (Now + TimeValue("0:00:10")) Unload UserForm1 End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "lahuwm" wrote: Hi, I am trying to build a macro for a histogram. When the macro is complete, I am asked "Histogram - Some data will be hidden by embedded chart(s)." I can click OK or cancel. How can I build my OK response into the macro so that I do not need to manually respond? Thank you for reviewing my question. |
Macro Message Box
If that message is system generated, then you canadd the following to your
code to eliminate the message: Application.DisplayAlerts = False ' Turns off system generated messages ....your code here... Application.DisplayAlerts = True ' Turns system generated messages back on HTH, Eric "lahuwm" wrote: Hi, I am trying to build a macro for a histogram. When the macro is complete, I am asked "Histogram - Some data will be hidden by embedded chart(s)." I can click OK or cancel. How can I build my OK response into the macro so that I do not need to manually respond? Thank you for reviewing my question. |
All times are GMT +1. The time now is 11:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com