VBA code to pop a message and allow user to access the workbook in middle of code

Balajibenz

Board Regular
Joined
Nov 18, 2020
Messages
80
Office Version
  1. 2013
Platform
  1. Windows
Hi Team,

I have VBA code which works with multiple sheets and have a scenario where user might need to intervene to do some manual changes in one of worksheet in the middle.

what i am looking for is to have a pop-up box where it asks user to do the changes if required and actually allow user to access one of the workbooks that is already opened and once users clicks on ok code should proceed as usual.

I tried to have it as - Msgbox "Please do the manual changes if required"

it is popping up but i am not able to access any of the workbooks that are opened. Can someone help me with this please.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I would suggest creating a UserForm instead of using MsgBox. MsgBox is modal, which means nothing else can happen as long as it is displayed. If you display a modeless UserForm the user can do anything.

However, you have to reengineer your code to be able to resume when the user clicks OK. To help with that I would need to see all of your code, with an indication of what point in the code you want this box to appear.
 
Upvote 0
Make the message box Yes/No (change sheet or not?) and if the response is yes, exit the sub. Or just prompt that it has to be taken care of it and Exit Sub.
Vague I know, but you didn't post any code. If you can't access your wb because the rest of your code runs, the above should take care of that. If it's because you opened it hidden, you'll have to unhide it.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,147
Members
453,021
Latest member
Justyna P

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