VBA Copy Paste Multiple Sheet to one Master Sheet

SuperMan02

New Member
Joined
Nov 21, 2016
Messages
6
Hello Everyone,

I would like to ask an assistance, I am new in scripting VBA and I need help on how I can transfer all the data from multiple sheets to one Master sheet in the Excel File.

I have 6 Sheets where I'll get the data and the data are in Range A7:K16 (this range applies to all the sheet). Not all rows are filled out, it will always depend if we received data from certain Accounts. I would like to transfer all of the data in the Master File wherein if the row are blank the next sheet will be paste in the master file in the next blank row.

Hope someone can help me and I truly appreciate your time.
 
Do you need something like this..UNTESTED

Code:
Sub MM1()
Dim ws As Worksheet, lr As Long, r As Long
lr = Sheets("Master").Cells(Rows.Count, "N").End(xlUp).Row + 1
For Each ws In Worksheets
    If ws.Name <> "Master" Then
     ws.Activate
     Range("A22:L31").Copy Sheets("Master").Range("N" & lr)
        lr = Sheets("Master").Cells(Rows.Count, "N").End(xlUp).Row + 1
    End If
Next ws
End Sub
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
There's no condition on the code wherein if Column L of all sheet is equal to "No" it will not be paste in Master Sheet

Do you need something like this..UNTESTED

Code:
Sub MM1()
Dim ws As Worksheet, lr As Long, r As Long
lr = Sheets("Master").Cells(Rows.Count, "N").End(xlUp).Row + 1
For Each ws In Worksheets
    If ws.Name <> "Master" Then
     ws.Activate
     Range("A22:L31").Copy Sheets("Master").Range("N" & lr)
        lr = Sheets("Master").Cells(Rows.Count, "N").End(xlUp).Row + 1
    End If
Next ws
End Sub
 
Upvote 0
UNTESTED

Code:
Sub MM1()
Dim ws As Worksheet, lr As Long, r As Long
lr = Sheets("Master").Cells(Rows.Count, "N").End(xlUp).Row + 1
For Each ws In Worksheets
    If ws.Name <> "Master" Then
     ws.Activate
        For r = 22 To 31
           If Range("L" & r).Value <> "No" Then
               Range("A" & r & ":L" & r).Copy Sheets("Master").Range("N" & lr)
               lr = Sheets("Master").Cells(Rows.Count, "N").End(xlUp).Row + 1
           End If
        Next r
    End If
Next ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,632
Messages
6,173,472
Members
452,516
Latest member
archcalx

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