Copy/paste from multiple sheets into master sheet

chris1979

Board Regular
Joined
Feb 23, 2016
Messages
52
Hi
Could you please assist
I have multiple sheets in the workbook where I want a vba code to copy till the last row and paste in the master sheet (from C12). Then go the next sheet copy till the last row and paste from the last copied line. It should create rows accordingly

Thank you
CT
 

Attachments

  • Master_sheet.PNG
    Master_sheet.PNG
    18.1 KB · Views: 12
  • Sheet2.PNG
    Sheet2.PNG
    10.6 KB · Views: 12
  • Sheet3.PNG
    Sheet3.PNG
    10.6 KB · Views: 12

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Sub CombineData()
Dim Sh As Worksheet
Dim LR As Long
Application.ScreenUpdating = False
Sheets("Master").Activate
With Range("B12:K120000")
.Clear
.UnMerge
End With
For Each Sh In Worksheets
If Sh.Name <> "Master" Then

If Sh.Range("A1") <> "" And Sh.Range("A2") <> "" Then
With Sh.Range("A1").CurrentRegion
.Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count).Copy ActiveSheet.Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
End With
End If

End If
Next Sh
LR = Range("C12").End(xlDown).Row
Range("B" & LR + 3) = " Thanks & Regards"
Range("B" & LR + 4) = " VM Team"

Range("C12").CurrentRegion.Borders.LineStyle = xlContinuous
Range("B2:K" & LR + 5).BorderAround , ColorIndex:=xlAutomatic, Weight:=xlThick '(lineStyle = xlContinuous, ColorIndex:=3, Weight:=xlThick)
Application.ScreenUpdating = True

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,061
Messages
6,122,922
Members
449,094
Latest member
teemeren

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