Enforce data entry prerequisite

wpryan

Well-known Member
Joined
May 26, 2009
Messages
534
Office Version
  1. 365
Platform
  1. Windows
Hi All,
I have a form where some data entry is expected, but prior to entering the data, a person must complete a prerequisite cell. In this case, I'd like it so if cell D50 is blank, then cells in range C10:C46 are locked. How is this possible?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Select C10:C46, then click Data > Data Validation
On Settings tab, select Allow > Custom
Beneath Formula, type: =$D$50<>""
Un-check the box next to "Ignore blank"
On the Error Alert tab, 'Show error alert....' should be checked, Style > Stop, and if you want a custom error message add that under Title & Error Message sections, e.g. "You must enter a value in cell D50 before entering data in C10:C46."
Click OK
 
Upvote 0
Solution
Select C10:C46, then click Data > Data Validation
On Settings tab, select Allow > Custom
Beneath Formula, type: =$D$50<>""
Un-check the box next to "Ignore blank"
On the Error Alert tab, 'Show error alert....' should be checked, Style > Stop, and if you want a custom error message add that under Title & Error Message sections, e.g. "You must enter a value in cell D50 before entering data in C10:C46."
Click OK
Thanks for the answer. The dialog box that comes up after the equation is False, gives the option to continue (Yes, No, Cancel or Help). If I hit Yes, I can enter the a value anyway without error...
 
Upvote 0
Thanks for the answer. The dialog box that comes up after the equation is False, gives the option to continue (Yes, No, Cancel or Help). If I hit Yes, I can enter the a value anyway without error...
Sorry, my bad... I reset the warning to "information" instead of "stop". Thanks for your correct answer...
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,636
Members
449,043
Latest member
farhansadik

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