Data Entry Restriction

jayson26

Board Regular
Joined
Aug 26, 2002
Messages
78
Is it possible to create a rule, function, formula, or VBA that would allow the user to ONLY enter specific values?

Example:

cell A1 is 6
in B1 I only want to allow entries of 6, 12, 18, 24, etc..

cell A2 is 4
in B2 I only want to allow entries of 4, 8, 12, 16, 20, etc..

Thanks!!!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Select the cell you want to restrict data entry then
click menu Data!Validation. In the "Allow" box choose "List" and in the "Source" box type the list of values like 3,6,9,12... Click Ok

GNaga
 
Upvote 0
Select cell B1, then select the entire column. Then, go to Data | Validation, and in "Custom" enter this formula

=MOD(B1, A1)=0

this will also allow B1 to be 0. If this can't happen, then use this one:

=(B1 > 0)*(MOD(B1, A1)=0)
 
Upvote 0

Forum statistics

Threads
1,221,693
Messages
6,161,356
Members
451,697
Latest member
pedroDH

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