VBA to Validate Data

PosieQ

New Member
Joined
Mar 14, 2017
Messages
8
Hello,

I am a true beginner to VBA and would like some help in creating a macro that is triggered when the user goes to save the document. The document contains a check box and, if checked, cell B28 will show TRUE. If the check box is checked, the user is expected to enter additional information in B30. I would like to create a macro with the following conditions so that a message appears when the user tries to save the document:

If B28 is TRUE and B30 is blank, show the message "Please enter a number in B30".

Please let me know if I have not provided enough information. Thank you in advance!
 
This worked. Thank you, and thanks for clarifying about having to use a user form for those command buttons!
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,216,175
Messages
6,129,299
Members
449,499
Latest member
HockeyBoi

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