Copying from multiple locations to the bottom of a column (always changing)

figgylynn1023

New Member
Joined
Jul 21, 2011
Messages
24
I have built a macro to pull data from multiple locations and copy it into a single excel template. I have reserved the two far left columns of the template for formula calculations, and want the macro code to ensure that the copying and pasting from the other excel docs to the template always starts the paste into the first open cell at the bottom of column C (wherever that happens to be when that document gets copied).

I've tried to following code, but it came up as an error for me:

Range("C1")Select
Selection.End(xlDown).Offset(1,0).Select
ActiveSheet.Paste

Any thoughts?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi figgylynn1023,

Welcome to the Board.

What is the error message you received?

I believe the first line in your code should be
Code:
Range("C1").Select
rather than
Code:
Range("C1")Select
but there's likely more to it than that.
 
Upvote 0
Welcome to the Board!

You didn't post how you're copying, but you can copy and paste to the first empty row like this:

Sheets("Sheet1").Range("A1").Copy Sheets("Sheet2").Cells(Rows.Count,"C").End(xlUp).Offset(1)

HTH,
 
Upvote 0
Thank you both for your suggestions. I ended up having another issue combine with this...a FillDown issue that made the copy area screwy.

I ended up using a formula of:

Code:
Windows("bf" & Day & "_2856.txt").Activate
ActiveSheet.UsedRange.Copy
Windows("bf" & Day & "_113.txt").Activate
Range("A65536").Select
Selection.End(xlUp).Offset(1,0).Activate
ActiveSheet.Paste

After I figured out my FillDown issue with:

Code:
Windows("bf" & Day & "_5298.txt").Activate
Range("A1").EntireColumn.Insert
Range("A1:A" & Range("B" & Rows.Count).End(xlUp).Row).Value="5298"

Thank you again for your assistance!
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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