ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA code (https://www.excelbanter.com/excel-programming/294056-vba-code.html)

W. Adam Glab

VBA code
 
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.



Chip Pearson

VBA code
 
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




"W. Adam Glab" wrote in message
om...
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.





Don Guillett[_4_]

VBA code
 
Why not try data validation.
select the cell(s) you wantdatavalidationallow customtype in
=and(a215,a2<75)

--
Don Guillett
SalesAid Software

"W. Adam Glab" wrote in message
om...
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.






All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com