Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you, great help
"Gary''s Student" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you wanted to do this directly on the worksheet without using a macro,
then you could use this formula (where your column letters are assumed to be in A1)... =IF(A1="","",COLUMN(INDIRECT(A1&"1"))) -- Rick (MVP - Excel) "danpt" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Alpha column lables | Excel Worksheet Functions | |||
find alpha in column 1 numeric column 2 | Excel Discussion (Misc queries) | |||
Alpha column references | Excel Discussion (Misc queries) | |||
alpha column changed to numerical column | New Users to Excel | |||
HELP w/ column Alpha | Excel Discussion (Misc queries) |