Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try Rons suggestion
Dim varused As Variant varused = Application.InputBox("Enter the value.", Type:=1) '// User cancelled If varused = False Then End MsgBox varused You should when ever possible try an intercept know return values as early as possible, using the Type:=1 forces the input to accept numbers only ie you have intercepted / masked out any Non numerics out earlier on and don't need to test for this. kkknie wrote in message ... This is how I do it: Code: -------------------- Dim strTemp as String Dim varused as double strTemp = Application.InputBox("Enter the value.") If Not IsNumeric(strTemp) Then 'Message non numeric and exit End If If Trim(strTemp) = "" Then 'Message blank and exit End If varused = CDbl(strTemp) -------------------- K --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2002 and VB declaring number as double | Excel Discussion (Misc queries) | |||
How do I assign range to variant and use | Excel Discussion (Misc queries) | |||
Testing if Variant is Range or Double? | Excel Programming | |||
Variant to String | Excel Programming | |||
DLLs and VBA: Who free's a variant? | Excel Programming |