Forum Discussion
CSPENNINE
Jan 27, 2021Copper Contributor
Data Validation Formula to limit cell input range based on value in another cell
Hi, This should be simple, but I cannot seem to find the same question asked before, and all solutions I have tried have failed. If I have cell A1 and it contains any text (other than "LIM...
- Jan 27, 2021
Select cell B1.
On the Data tab of the ribbon, click Data Validation.
Select Custom from the Allow dropdown.
Enter the following in the Formula box:
=OR(A1<>"LIMIT",AND(B1>=0,B1<=10))
If you wish, enter appropriate messages in the Input Message and Error Alert tabs.
Click OK.
HansVogelaar
Jan 26, 2023MVP
See the attached sample workbook. You are allowed to select 'Yes' at most 5 times.
There is VBA code in the worksheet module. Right-click the sheet tab and select 'View Code' to inspect the code, and to change the number of times 'Yes' can be selected, if you wish.
You'll have to allow macros when you open the workbook.
Iceman123
Jan 26, 2023Copper Contributor