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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,216,235
Messages
6,129,650
Members
449,524
Latest member
RAmraj R

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