I have code to open up a workbook and to copy and paste the data
I need the code amended to copy data from sheet 3 onwards and paste these into the destination workbook into the same sheet name for eg if source sheet is BR1 Sales, then BR1 Sales in source sheet to be copied into sheet Br1 Sales etc.
your assistance is most appreciated
I need the code amended to copy data from sheet 3 onwards and paste these into the destination workbook into the same sheet name for eg if source sheet is BR1 Sales, then BR1 Sales in source sheet to be copied into sheet Br1 Sales etc.
your assistance is most appreciated
Code:
Sub copyDataFromSource()
Dim fileSource, lr As Long
Application.ScreenUpdating = False
fileSource = Application.GetOpenFilename
If fileSource = False Or IsEmpty(fileSource) Then Exit Sub
With Workbooks.Open(fileSource)
With .Sheets("BR1 Sales")
lr = Range("D" & Rows.Count).End(xlUp).Row
Range("A6:E" & lr).Copy
ThisWorkbook.Sheets("Data").Range("A" & Rows.Count).End(xlUp).Offset(1).Paste
Application.CutCopyMode = False
End With
.Close False
End With
Application.ScreenUpdating = True
End Sub