VBA MsgBox - Excel 2010

cwunderlich

Board Regular
Joined
Sep 24, 2010
Messages
101
I have a macro that runs and throughout the macro the user is presented with several vbYesNo message boxes. However, when they make their choice on each one, each message box stays displayed on this screen. Once they pick Yes or No (or Cancel), I would like the message box to go away and the code to continue to run. I thought it would just be a simple matter of putting Application.ScreenUpdating around the msgbox but this doesn't seem to be the case....

Any ideas?
 
Last edited:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I should also note that throughout this macro I have application.screenupdating set = false. I think that if this were set = True for the whole macro then the message boxes would go away. However, I was screenupating to = false for this because it is opening a lot of files, etc...
 
Upvote 0
I already have the necessary message boxes setup throughout the code. I would rather not use a userform, the message boxes are very simple and easy to work with as they are...
 
Upvote 0
I have a macro that runs and throughout the macro the user is presented with several vbYesNo message boxes. However, when they make their choice on each one, each message box stays displayed on this screen. Once they pick Yes or No (or Cancel), I would like the message box to go away and the code to continue to run. I thought it would just be a simple matter of putting Application.ScreenUpdating around the msgbox but this doesn't seem to be the case....

Any ideas?
So does ScreenUpdating = False for the rest of the macro?

I find that ScreenUpdating is sometimes a bit slow. Maybe try turning it off a few more lines after the MsgBox to give the MsgBox a chance to get out of the way?

Just a thought as I had a similar problem recently.

Chris.
 
Upvote 0
So does ScreenUpdating = False for the rest of the macro?

I find that ScreenUpdating is sometimes a bit slow. Maybe try turning it off a few more lines after the MsgBox to give the MsgBox a chance to get out of the way?

Just a thought as I had a similar problem recently.

Chris.

ugh, that is what I feared was the case... I can try that, it'll just be a hassle figuring out where the "right" spot is to insert ScreenUpdating = False back after the MsgBox. (right before the MsgBox, I have ScreenUpdating = True).

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top