Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, both!
-- Thanks for your help. Karen53 "Karen53" wrote: Hi, I've been trying to validate the value of a textbox with partial success. The value input must be a number but it can also be a decimal number. I am trying to catch alpha characters but my Like statement is not catching it. I have tried various versions, "A-Z", "a' - "z", a-z. Sub EditAllowedVariance(PasswordGood) Dim NuAllowance As String If PasswordGood = True Then NuAllowance = InputBox("Enter desired allowed variance", _ "Enter Variance") If NuAllowance Like ["a-z"] Then MsgBox "Variance must be a number" Goto InvalidNo End If If Val(NuAllowance) < 0 Then MsgBox "Allowance must be positive number" GoTo InvalidNo Else GrossUppg.Range("I2").NumberFormat = "00.00" GrossUppg.Range("I2").Value = Val(NuAllowance) End If End If InvalidNo: End Sub -- Thanks for your help. Karen53 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validating cells | Excel Discussion (Misc queries) | |||
validating | Excel Discussion (Misc queries) | |||
validating | Excel Worksheet Functions | |||
Validating | Excel Discussion (Misc queries) | |||
Validating in VBA | Excel Programming |