ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need to obtain Col Letter - VBA (https://www.excelbanter.com/excel-discussion-misc-queries/220832-need-obtain-col-letter-vba.html)

Emece

Need to obtain Col Letter - VBA
 
Hi.

I have a macro, and I need to obtain the col letter and not the number, so
as to go to one column to another, adding 1. I entered the following code:

ActiveCell.Column = ActiveCell.Column + 1

But ActiveCell.Column returns the column number, which is the correct code?

Thanks in advance

Regards

Emece.-

Don Guillett

Need to obtain Col Letter - VBA
 
You can use the column number in CELLS
cells(2,activecell.column)
range(cells(2,activecell.column),cells(22,activece ll.column))
where the first number is the row and the second the column

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Emece" wrote in message
...
Hi.

I have a macro, and I need to obtain the col letter and not the number, so
as to go to one column to another, adding 1. I entered the following code:

ActiveCell.Column = ActiveCell.Column + 1

But ActiveCell.Column returns the column number, which is the correct
code?

Thanks in advance

Regards

Emece.-




All times are GMT +1. The time now is 12:24 AM.

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