Move to column "A" in a row with VBA?

luporiman

New Member
Joined
Aug 13, 2009
Messages
11
Hello,

I'm a self-taught VBA user. I am trying to figure out how to stay in the same row, but move to column "A", regardless of what column I am currently in.

I don't think I can use the ActiveCell.Offset() command because I need to move a variable number of columns.

Any help will be greatly appreciated. Thanks!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
welcome to the board...

not sure what you are trying to do...this will refence column A of the current row you are in...if that's not what you are after post some of your code and point out where it's not working

Code:
cells(activecell.row,"A").value
 
Upvote 0
Hi & Welcome to the Board!

Perhaps:

Code:
Activecell.Entirerow.Range("A1").Activate

or:

Code:
Cells(Activecell.Row,"A").Activate
 
Upvote 0
I am getting debug errors when I try your suggestions (not sure if it is notable that I am useing Excel 2003).


I started with the code below, and my goal is to have my next line of code move me to cell D4, regardless of the column I put into the range command.


Range("D1").Select

ActiveCell.Offset(3, 0).Select

(Line of code that will moce me to column A regardless of current column)


This is part of a much larger macro where my ultimate goal is to copy data from one file (improperly formatted) into another. I need the macro to start copying data into column A of the next row when it encounters a certain text string.

I think I can pull that off if I can successfully change columns within the row.
 
Upvote 0
if you just want to move to column A based on the row you are in then Richard's code should work just fine

Code:
Cells(Activecell.Row,"A").Activate

but if you are just moving to copy something there then there is probably an easier way...also in your code above doing the .Select on cells is normally not needed...
 
Upvote 0
I right-clicked the yellow line of code and asked for the "Definition", and the message I got states:

"Can not jump to active cell because it is hidden"


I don't have any hidden cells in the worksheet, so I'm not sure what to make of that.
 
Upvote 0
So, I closed the sheet and re-opened it and now the code is working.

I can't thank you guys enough for the help!
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top