VBA code

W

W. Adam Glab

I have a cell that data put into it needs to be validated, with upper and
lower limits. Need to write click event which will control data input within
the limits, for example:
Input box can only accept between 15 and 75, any idea how to write the code.
Do while numbers ...........................


Loop

Thanks for your help.
 
C

Chip Pearson

Rather than using code, you can use Data Validation to do this.
Select the cell in question, then go to the Data menu and choose
Validation. In the Allow drop down, choose "Decimal" and in the
Data drop down, choose "between". Enter 15 and 75 as the minimum
and maximum values.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
D

Don Guillett

Why not try data validation.
select the cell(s) you want>data>validation>allow custom>type in
=and(a2>15,a2<75)
 
Top