I was writing a prompter which essentially looks like:
When I input the value A:M, then everything works just fine. But when I started testing for errors, I input the range 1:2, and got a fraction (0.04395...). THAT was a surprise. Moreover, when I tested it with:Sub TestPrompt() Dim Ans As Variant, Msg As String Msg = "Input the range (letters only ... no rows)" & vbCr & _ "Ex: G:S" Ans = Application.InputBox(Msg, "Test", Type:=6) 'A string or a logical value (2 + 4) MsgBox "Ans = " & Ans End Sub
Application.ISNUMBER(UCase(Trim(Ans)))
I got FALSE. So I changed it to:
Application.ISNUMBER(CDbl(UCase(Trim(ANS))))
I got TRUE.
What's going on here?? Why did I get a fraction? Does it maybe think that 1:2 is a time value perhaps?