View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default VBA Column Conversion


'-----------------------------------------------------------------
Function ColumnLetter(Col As Long)
'-----------------------------------------------------------------
Dim sColumn As String
On Error Resume Next
sColumn = Split(Columns(Col).Address(, False), ":")(1)
On Error GoTo 0
ColumnLetter = sColumn
End Function



--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"kramer31" wrote in message
oups.com...
Is there a function that converts integers (as used in programming
loops) to excel colums letters?

For instance:

Worksheet.Cells(1,1).Formula = Sum(HypotheticalFunc(2) & "1:" &
HypotheticalFunc(26) & "1")

Should place the Formula "=Sum("B1:Z1") into the cell A1

If not, I'll write it, but it seems as if it should exist.