copying a row to a different tab

rmccafferty

Board Regular
Joined
Jul 16, 2009
Messages
60
I would like to copy a row in one tab (tab a) to the current cell in a different tab (tab b).

I have already run a macro that goes to tab b, goes to A200 (well below my data) and then does an End-Up arrow, and then down one row so the cursor is in column A of the highest empty row. I then assign that cell address to a variable c.

Back in Tab a I would like to use some variation of
ActiveCell.EntireRow.Copy Destination:=Range("??"). I would like to use my variable "c" to fill in the Range if possible. Would an entry like the following work?

ActiveCell.EntireRow.Copy Destination: Sheets("tab b").ActiveCell.EntireRow.Paste
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try

Code:
ActiveCell.EntireRow.Copy Destination:=Sheets("tab b").Range("A" & Rows.Count).End(xlUp).Offset(1)
 
Upvote 0
Thank you for the help. I am a lightweight with VBA.

As explanation, I assume the the "A" reference is just a way to say the current location?

It is not clear to me what Rows.Count does.

Of course whatever works counts, I am just always curious how and why it works.
 
Upvote 0
Code:
Sheets("tab b").Range("A" & Rows.Count).End(xlUp).Offset (1)

returns the first blank row in column A.
 
Upvote 0

Forum statistics

Threads
1,224,538
Messages
6,179,412
Members
452,912
Latest member
alicemil

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