Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default Covert Column Numbers to Column Letters in Excel VB

I found the function ConvertFormula and modified it for my needs. It changes
R1C1 tstyle to A1. Since I had all the row and column numbers, it worked
great. Thank you for your help!

See Below:

Function CreateRange( StartRowNum, StartColNum, EndRowNum, EndColNum As
Long)
InputFormula = ConvertRefStyle("R" & StartRowNum & "C" & StartColNum)
InputFormula = InputFormula & ":" & ConvertRefStyle("R" & EndRowNum &
"C" & EndColNum)

Function ConvertRefStyle(InputFormula As String)
ConvertRefStyle = Application.ConvertFormula(Formula:=InputFormula, _
fromReferenceStyle:=xlR1C1, toReferenceStyle:=xlA1)
End Function



"Andibevan" wrote:

Here You go -- Column Letter = CHR(COLNUM + 64)

HTH

Andi

"Keith" wrote in message
...
Is there a Excel VB function that can take a column number and convert it

to
a column letter? I can write one on my own, but I hope that there is a

built
in function to do this. Some properties will only use column letters and
this presents a problem.

Thank you in advance for any help you can provide.





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
Excel - lost my row numbers and column letters Mare[_2_] Excel Discussion (Misc queries) 4 April 30th 23 11:43 AM
In Excel why have column headings gone from Letters to Numbers Will Excel Discussion (Misc queries) 3 January 13th 09 02:58 PM
The column name on Excel are numbers instead of letters Sab Excel Discussion (Misc queries) 1 May 21st 07 06:59 PM
How can I change column numbers back to column letters? Space Elf Excel Worksheet Functions 3 March 2nd 06 09:35 PM
Excel column headings from numbers to letters happygolucky Excel Discussion (Misc queries) 2 January 21st 05 06:15 PM


All times are GMT +1. The time now is 09:17 AM.

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"