View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Alpha to Numeral column name

Sub Numerify()
Dim s As String, n As Long, r As Range
s = Application.InputBox(Prompt:="give me the letters", Type:=2)
Set r = Range(s & 1)
MsgBox (r.Column)
End Sub

--
Gary''s Student - gsnu200856


"danpt" wrote:

I need a macro or function to translate alphabetic column name to numeral
column number like:
Sub alphatonumeral()
Dim alpha, numeral As Variant
alpha = UCase(InputBox(prompt:="What is the alphabetic column name?"))
' translation body will be similar to formula "=column(BA:BA)" if input
alpha is BA
numeral = 53 ' for BA
MsgBox numeral
End Sub