LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Validating with Like

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating cells [email protected] Excel Discussion (Misc queries) 1 October 30th 08 12:53 AM
validating Philashley Excel Discussion (Misc queries) 2 March 13th 08 03:54 PM
validating Ayesha Excel Worksheet Functions 2 April 26th 06 02:56 PM
Validating Sdbenn90 Excel Discussion (Misc queries) 0 March 27th 06 12:05 AM
Validating in VBA Casey C Excel Programming 7 November 25th 05 08:22 PM


All times are GMT +1. The time now is 07:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"