ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to retrieve Excel column as a string (AAA instead of 703) (https://www.excelbanter.com/excel-programming/395497-how-retrieve-excel-column-string-aaa-instead-703-a.html)

Aggie

How to retrieve Excel column as a string (AAA instead of 703)
 
Hello

I was using GetProperty to retrieve the column on an Excel spreadsheet, but
it returns me the number of column ..

Is there a way I get the corresponding column name, I mean using the letters
instead of the number? (like getting AAA instead of 703, or ZZ instead of
702).

--
thanks so much.

Ron de Bruin

How to retrieve Excel column as a string (AAA instead of 703)
 
Hi Aggie

You can use this function from Chip Pearson

Function ColumnLetter(R As Range) As String
ColumnLetter = Left(R.Address(False, False), _
1 - (R.Column 26) - (R.Column 702))
End Function




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Aggie" wrote in message ...
Hello

I was using GetProperty to retrieve the column on an Excel spreadsheet, but
it returns me the number of column ..

Is there a way I get the corresponding column name, I mean using the letters
instead of the number? (like getting AAA instead of 703, or ZZ instead of
702).

--
thanks so much.



All times are GMT +1. The time now is 03:34 PM.

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