Quote Originally Posted by Cyberdude
I was writing a prompter which essentially looks like:

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
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:
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?
It appears that you are getting fractions of 24 hours. Note that if you enter 24: the value of Ans is 1.0 and if you enter 12: the value of Ans is 0.50 Similarly 1: yields 0.04166 which is 1/24.

Given those results, one would expect that 1:2 would be interpreted as 1 hr and 2 min or 1.0333 hours. And 1.0333/24 = 0.043055 which is what Ans is when 1:2 is entered.

Now why you got 0.04395 is a mystery.

If you want a REALLY interesting result, try something like -24:

InputBox does not normally interpret math or format symbols as anything other than characters. But in this case, the ":" is clearly being interpreted otherwise.