View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default convert letters to numbers

How about:

Sub dural()
Dim s As String
s = Application.InputBox(prompt:="enter a column letter:", Type:=2)
S2 = s & ":" & s
n = Range(S2).Column
MsgBox (n)
End Sub
--
Gary''s Student - gsnu201003


"JT" wrote:

How do I convert letters to numbers with VBA. On one of the sheets in my
macro there is a date field. The user indicates the date field by entering
"F" or "B" or "L" in a specific cell on another sheet. Some users will enter
1 or 2 or 4 and it is not a problem. However, some users enter letters and I
need to convert those letters to the appropriate number, so I know which
column contains dates.

Thanks for the help.

--
JT