Message Box and User Input in VBA

sax2play

Board Regular
Joined
Mar 13, 2021
Messages
63
Office Version
  1. 2016
Platform
  1. Windows
Good Morning All,

I have a dynamic drop down list in cell N7. The cell is blank at the start of the macro, and then I need the user to select an option from the drop down list during the macro. The macro is set to prompt the user to make a selection; however the user cannot make the selection until pressing "OK" at which point the macro checks whether field N7 has text and ends the routine. How do I pause the macro to allow the user to make a selection from the drop down before checking whether N7 is blank and displaying the message box again or proceeding with the routine?

Thanks!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Exit the macro after telling the user to pick an item.
If the drop box is good, then the macro continues:

Code:
sub MyMacro()
if cboBox  ="" then
   msgbox "You must choose an item"
   exit sub
endif

'run the full macro here...

end sub
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

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