Copy Paste data from multiple sheets to last row each time on combined sheet in another workbook

NateD1

New Member
Joined
Apr 1, 2020
Messages
46
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am looking for a VBA code that copys data from Col. A:G, from Sheets1 to Sheet7, and pastes the data each time to the last row so it is stacked in order.
the data needs to be copied in that way from one workbook, onto one sheet in another workbook.

could someone please help me with a code to do this, saving me copy and pasting manually each time..

thanks
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Can you please provide
a) the name of the workbook being copied from
b) the name of the workbook being copied to
c) the name of the worksheet being copied to

Also is Sheets1 to Sheet7... the sheets index i.e. it's position, it's tab name or it's codename. Also is it Sheets 1, Sheet1 or something else?
 
Upvote 0
Here is some generic code. You will need to edit workbook and sheet names.

VBA Code:
Sub t()
Dim i As Long, sh As Worksheet
Set sh = Workbooks(2).Sheets(1) 'Edit names of destination workbook and sheet
    For i = 1 To 7
        With Workbooks(1).Sheets(i) 'Do not edit the i variable but do edit the workbook name
            Intersect(.UsedRange, .Range("A:G")).Copy
            sh.Cells(Rows.Count, 1).End(xlUp)(2).PasteSpecial xlPasteValuesAndNumberFormats
        End With
    Next
End Sub
 
Upvote 0
Can you please provide
a) the name of the workbook being copied from
b) the name of the workbook being copied to
c) the name of the worksheet being copied to

Also is Sheets1 to Sheet7... the sheets index i.e. it's position, it's tab name or it's codename. Also is it Sheets 1, Sheet1 or something else?
@MARK858 - might as well include directories for each workbook and whether the wbs are opened or closed.
 
Upvote 0
@MARK858 - might as well include directories for each workbook and whether the wbs are opened or closed.
No because I assume the workbooks are open until told otherwise, the workbook names are needed in virtually all cases (too often posted code with instructions to alter workbook name to suit and the OP either hasn't or has done it incorrectly).

If you wish to post code without the info then that is fine by me.
 
Upvote 0
If you wish to post code without the info then that is fine by me.
No, you are right. It is better if the OP provides the info up front. But I sometimes give the new members some leeway and give them generic code to play with. Then if they can't manage that, we get to the brass tacks.
Regards, JLG
 
Upvote 0
Can you please provide
a) the name of the workbook being copied from
b) the name of the workbook being copied to
c) the name of the worksheet being copied to

Also is Sheets1 to Sheet7... the sheets index i.e. it's position, it's tab name or it's codename. Also is it Sheets 1, Sheet1 or something else?

thank you for replying, the name of the
workbook copied from: ST.CC."dd/mm".xlsx (date at the end) a new file is saved each day in same format. so ideally would just need to change a date somewhere for the macro to pull from that particular file. this workbook is always closed when the data is to be pulled.
workbook copied to: Daily PVA.xlsm
Sheet codename: Sheet3,Sheet4,Sheet5,Sheet6,Sheet7,
 
Upvote 0
thank you for replying, the name of the
workbook copied from: ST.CC."dd/mm".xlsx (date at the end) a new file is saved each day in same format. so ideally would just need to change a date somewhere for the macro to pull from that particular file. this workbook is always closed when the data is to be pulled.
workbook copied to: Daily PVA.xlsm
Sheet codename: Sheet3,Sheet4,Sheet5,Sheet6,Sheet7,
Worksheet codename being copied to: Sheet2
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,322
Members
448,564
Latest member
ED38

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