Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Alpha to Numeral column name

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   Report Post  
Posted to microsoft.public.excel.misc
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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Alpha to Numeral column name

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Alpha to Numeral column name

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alpha column lables Oly User Excel Worksheet Functions 2 May 29th 08 05:14 PM
find alpha in column 1 numeric column 2 JANeyer Excel Discussion (Misc queries) 2 February 26th 08 04:44 AM
Alpha column references grono Excel Discussion (Misc queries) 1 July 5th 07 01:18 PM
alpha column changed to numerical column DianeMcP New Users to Excel 3 November 7th 05 07:01 PM
HELP w/ column Alpha Lady Di in STL Excel Discussion (Misc queries) 2 February 3rd 05 05:35 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"