ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   return colmn number + index (https://www.excelbanter.com/excel-programming/332874-return-colmn-number-index.html)

medicenpringles[_11_]

return colmn number + index
 

is there any way to return the LETTER name of a column? the .Column
property returns the index, but is there a simple way of returning the
A, B, and so on value of column? this is what i would like to do:


Dim myRange as Range
Dim rowCopy as Integer
Dim colCopy as Integer
Dim colCopyLetter as String
Dim NewRange as String

Set rowCopy = myRange.Row
Set colCopy = myRange.Column
Set colCopyLetter = ???
Set NewRange = ColCopyLetter & rowCopy

'some code

Set myRange = (NewRange)


--
medicenpringles


------------------------------------------------------------------------
medicenpringles's Profile: http://www.excelforum.com/member.php...o&userid=16458
View this thread: http://www.excelforum.com/showthread...hreadid=382337


Don Guillett[_4_]

return colmn number + index
 
look here for ways
http://tinyurl.com/7fyl8

--
Don Guillett
SalesAid Software

"medicenpringles"
<medicenpringles.1r8zeb_1119812709.2956@excelfor um-nospam.com wrote in
message news:medicenpringles.1r8zeb_1119812709.2956@excelf orum-nospam.com...

is there any way to return the LETTER name of a column? the .Column
property returns the index, but is there a simple way of returning the
A, B, and so on value of column? this is what i would like to do:


Dim myRange as Range
Dim rowCopy as Integer
Dim colCopy as Integer
Dim colCopyLetter as String
Dim NewRange as String

Set rowCopy = myRange.Row
Set colCopy = myRange.Column
Set colCopyLetter = ???
Set NewRange = ColCopyLetter & rowCopy

'some code

Set myRange = (NewRange)


--
medicenpringles


------------------------------------------------------------------------
medicenpringles's Profile:

http://www.excelforum.com/member.php...o&userid=16458
View this thread: http://www.excelforum.com/showthread...hreadid=382337




Vasant Nanavati

return colmn number + index
 
Lots of errors here. Try:

Dim myRange as Range
Dim rowCopy as Long
Dim colCopy as Integer
Dim colCopyLetter as String
Dim NewRange as String

rowCopy = myRange.Row
colCopy = myRange.Column
colCopyLetter = Left(myRange(1, 1).Address(False, False), _
1 - CInt(myRange(1, 1).Column 26))
NewRange = ColCopyLetter & rowCopy

'some code

Set myRange = Range(NewRange)

But honestly, I don't quite understand what you are trying to do.

--

Vasant


"medicenpringles"
<medicenpringles.1r8zeb_1119812709.2956@excelfor um-nospam.com wrote in
message news:medicenpringles.1r8zeb_1119812709.2956@excelf orum-nospam.com...

is there any way to return the LETTER name of a column? the .Column
property returns the index, but is there a simple way of returning the
A, B, and so on value of column? this is what i would like to do:


Dim myRange as Range
Dim rowCopy as Integer
Dim colCopy as Integer
Dim colCopyLetter as String
Dim NewRange as String

Set rowCopy = myRange.Row
Set colCopy = myRange.Column
Set colCopyLetter = ???
Set NewRange = ColCopyLetter & rowCopy

'some code

Set myRange = (NewRange)


--
medicenpringles


------------------------------------------------------------------------
medicenpringles's Profile:
http://www.excelforum.com/member.php...o&userid=16458
View this thread: http://www.excelforum.com/showthread...hreadid=382337





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

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