Macro to paste data into next open row.

bubbataks

New Member
Joined
Mar 6, 2019
Messages
10
Hello! Looking for some assistance with what is hopefully an easy macro.

Looking for a macro to copy the data in cells AA1, AB1 and AC1 into the next open row for columns B, C and D. The data is all on the same sheet, but the data in AA1, AB1 and AC1 will be changing.

Thank you!
 

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.
Hello Bubbataks,

If the source and destination data is always fixed and on the same sheet, then perhaps the following is all that you need:-

Code:
Sub Test()

Sheet1.Range("AA1:AC1").Copy Sheet1.Range("B" & Rows.Count).End(3)(2)

End Sub

You may have to change the sheet references to suit yourself.

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Actually, I'm sorry, but now I'm running into another error. The data in AA, AB and AC are all referenced from a different sheet. So cell AA1 has the formula "=Sheet2!G1" , cell AB1 has the formulate "=Sheet2G2" and so on.

When I run the macro, my data is returning "0" for each cell.

How do I get it to display just the text that was in AA1, AB1 and AC1?

Thank you!
 
Upvote 0
Hello Bubbataks,

A small addition to the code should fix that for you:-


Code:
Sub Test()

Sheet1.Range("AA1:AC1").Copy
Sheet1.Range("B" & Rows.Count).End(3)(2)[COLOR=#ff0000].PasteSpecial xlValues[/COLOR]

End Sub


Cheerio,
vcoolio.
 
Upvote 0
You're welcome Bubbataks. I'm glad that I was able to help.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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