how to acitivate column A

O

Oliver Wagner

Hello,

This may be a really simple one but does anyone know how to activate column A???

The Problem:
- I don't know which row ActiveCell is
- I don't know wich column ActiveCell is
(therefore ActiveCell.Offset(x,y).Activate does not work, since I don't have y!?
Both change permanently and I need a method to activate column A using the actual row.

Thx

Oliver
 
L

Lisetsky Mykola

Oliver Wagner said:
This may be a really simple one but does anyone know how to activate
column A???

Might be I didn't clearly understand your question but why the code

ActiveSheet.Columns("A:A").Select

doesn't satisfy you?
 
O

Oliver Wagner

Might be I didn't clearly understand your question but why the code

ActiveSheet.Columns("A:A").Select

doesn't satisfy you?<
because I don't want to mark the whole column.

Let's say activecell is $G$8. What I want is to set the focus on $A$8. But I don't know which row and which column are active. I always want to activate column A of the active row.

Thx

Oliver
 
M

Martin Seelhofer

Hi Oliver
Let's say activecell is $G$8. What I want is to set the focus on $A$8.
But I don't know which row and which column are active. I always
want to activate column A of the active row.

Well, you surely are able to find out the row number, use ActiveCell.Row ;-)

I suggest you use something like this:

ActiveCell.EntireRow.Resize(1,1).Select
Or:
ActiveSheet.Cells(activecell.Row,1).select


Cheers,
Martin
 
L

Lisetsky Mykola

Oliver Wagner said:
Let's say activecell is $G$8. What I want is to set the focus on $A$8. But
I don't know which row and which column are active. I always want to
activate column A of the active row.

Well. I soppose the next code will do what you need:

ActiveSheet.Cells(ActiveCell.Row, 1).Select
 
O

Oliver Wagner

Hi Mykola and Martin,

thx for your solutions. Both work fine. Exaktly what I was looking for!

Meanwhile I found another one:
ActiveCell.Offset(0, -ActiveCell.Column + 1).Activate

Have a nice day
Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top