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
35
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
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
13,959
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
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?
 

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
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
 

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
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.
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
13,959
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile

ADVERTISEMENT

@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.
 

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
12,979
Office Version
  1. 2013
Platform
  1. Windows
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
 

NateD1

New Member
Joined
Apr 1, 2020
Messages
35
Office Version
  1. 365
Platform
  1. Windows
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,
 

NateD1

New Member
Joined
Apr 1, 2020
Messages
35
Office Version
  1. 365
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,126,998
Messages
5,622,089
Members
415,875
Latest member
Tarali

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
Top