ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Column reference (https://www.excelbanter.com/excel-programming/316705-column-reference.html)

Glen Mettler[_4_]

Column reference
 
I need to capture the alpha address of a column. For example, I know that
column 5 is "E" but how can I do that programmatically?
Suppose I have column 37 - how can I capture the alpha address?

Glen



Glen Mettler[_4_]

Column reference
 
Disregard. I got it from www.dicks-blog .com

ColLetter = Left(Cells(1, ColNumber).Address(False, False), _
1 - (ColNumber 26))
neat!!

Glen
"Glen Mettler" wrote in message
...
I need to capture the alpha address of a column. For example, I know that
column 5 is "E" but how can I do that programmatically?
Suppose I have column 37 - how can I capture the alpha address?

Glen





Rob van Gelder[_4_]

Column reference
 
strColumn = Split(Columns(lngColumn).Address(, False), ":")(1)

where lngColumn is the column number.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Glen Mettler" wrote in message
...
I need to capture the alpha address of a column. For example, I know that
column 5 is "E" but how can I do that programmatically?
Suppose I have column 37 - how can I capture the alpha address?

Glen






All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com