Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert column number to letter
Try this User Defined Function
Function GetColLet(ColNumber As Integer) As String GetColLet = Left(Cells(1, ColNumber).Address(False, False), _ 1 - (ColNumber 26)) End Function usage is =GetColLet(25) will return Y Can be called from a Sub Sub getlet() Dim numcol As Integer numcol = InputBox("enter a number") MsgBox "The column is " & GetColLet(numcol) End Sub Gord Dibben Excel MVP On 24 Oct 2005 12:29:55 -0700, "lvcha.gouqizi" wrote: If I know a cell's column number is 25, how can I know what letter its column represent? Just like that, the column 2 is actually column "B". Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert column number to letter
Convert the sheet to letter:-
With Application .ReferenceStyle = x1R1C1 .EnableSound = False .RollZoom = False End With End Sub Convert the sheet to numbers:- With Application .ReferenceStyle = xlR1C1 .StandardFont = "Arial" .StandardFontSize = "10" .EnableSound = False .RollZoom = False End With End Sub -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Column Header - Convert a Number to a letter | Excel Discussion (Misc queries) | |||
convert column number to letter | Excel Programming | |||
convert column number to letter | Excel Programming | |||
convert column number to letter | Excel Programming |