Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for Logical Operators to Limit Input?
Good Morning, I am creating a data entry form and have followed the tutorials written by Peter Aitken in MSDN . He shows how to limit entry to numerical values and that is very clear. I am trying to allow the user to enter a percent such as 21.2%. I just can't seem to find the right syntax . I can limit to the decimal point or to the percent sign with a single statement. Or I can limit to the numerical range of 1 through 9, but I can't seem to do all three with one statement. Here is the last statement I tried: Private Sub txtSolidsRaw_KeyPress(ByVal KeyAscii _ As MSForms.ReturnInteger) If KeyAscii < 36 Or KeyAscii < 46 Or KeyAscii < 48 _ Or KeyAscii < 49 Or KeyAscii < 50 Or KeyAscii < 51 _ Or KeyAscii < 52 Or KeyAscii < 53 Or KeyAscii < 54 _ Or KeyAscii < 55 Or KeyAscii < 56 Or KeyAscii < 57 Then KeyAscii = 0 End If End Sub -- DCSwearingen ------------------------------------------------------------------------ DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506 View this thread: http://www.excelforum.com/showthread...hreadid=499375 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Logical operators not working with text??? | Excel Worksheet Functions | |||
Limit on logical function | Excel Discussion (Misc queries) | |||
IF STATEMENT - HOW TO STRUCTURE THE LOGICAL OPERATORS | New Users to Excel | |||
Can logical operators be used within Conditional Formatting? | Excel Discussion (Misc queries) | |||
How to input a range in a logical test? | Excel Programming |