![]() |
Limit range of values for integer
In VBA (used in Excel), is there a way to limit the range of values of
a variable. For example, if I want to have an integer but only have it range from 1 - 100 in value, how would I do that. Thanks, Alan |
Limit range of values for integer
you could test for the value of the interger. something like this:
If i 0 or <=100 then 'do something here Else MsgBox "Please pick integer in the range of 1-100" End If ....you could also use a SELECT....CASE block |
Limit range of values for integer
correction "AND" instead of OR
If i 0 AND <=100 then * 'do something here Else * *MsgBox "Please pick integer in the range of 1-100" End If ...you could also use a SELECT....CASE block |
All times are GMT +1. The time now is 06:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com