Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Column letter to number
Anybody have some code to convert a column letter to it's column number
equivalent? -- Andrew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Column letter to number
Function courtesy of Chip Pearson:
Function ColumnNumber(ColLetter) As Integer ColumnNumber = Cells(1, ColLetter).Column End Function "slymeat" wrote: Anybody have some code to convert a column letter to it's column number equivalent? -- Andrew |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Column letter to number
and from bob phillips
'----------------------------------------------------------------- Function ColumnLetter(Col As Long) '----------------------------------------------------------------- Dim sColumn As String sColumn = Split(Columns(Col).Address(, False), ":")(1) ColumnLetter = sColumn End Function -- Gary "Toppers" wrote in message ... Function courtesy of Chip Pearson: Function ColumnNumber(ColLetter) As Integer ColumnNumber = Cells(1, ColLetter).Column End Function "slymeat" wrote: Anybody have some code to convert a column letter to it's column number equivalent? -- Andrew |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Column letter to number
colNum = Range(colLetter & "1").column
where colLetter is a variable with the letter(s) in it. -- HTH RP (remove nothere from the email address if mailing direct) "slymeat" .(donotspam) wrote in message ... Anybody have some code to convert a column letter to it's column number equivalent? -- Andrew |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Column letter to number
A simple one:
Sub Test() colname = InputBox("Enter column") 'This is the one that does the trick outp = Columns(colname).Column MsgBox ("col no is " & outp) End Sub slymeat (donotspam) wrote: Anybody have some code to convert a column letter to it's column number equivalent? -- Andrew |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Column letter to number
Thanks to all those who answered this. I only need one, but this will help
me also. "Toppers" wrote: Function courtesy of Chip Pearson: Function ColumnNumber(ColLetter) As Integer ColumnNumber = Cells(1, ColLetter).Column End Function "slymeat" wrote: Anybody have some code to convert a column letter to it's column number equivalent? -- Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert column number to letter | Excel Programming | |||
convert column number to letter | Excel Programming | |||
convert column number to letter | Excel Programming | |||
convert column number to letter | Excel Programming |