I am pulling data from multiple workbooks, often hundreds. The macro pulls all the data correctly from the other workbooks to the master sheet (PO Access) but then pulls B7:K36 from the master sheet resulting in a small amount of duplicate partial data. I have tried to use <> the master workbook but it does not seem to be recognized. If I remove the <> lines I get the same results. I have included the entire macro below.
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+d
Set outplace = Workbooks("PO Access").Sheets("sheet1")
'
For Each wb In Workbooks
If wb.Name <> "PO Access" Then
wb.Sheets("sheet1").Range("A3:F3").Copy
outrow = WorksheetFunction.Max(8, outplace.Range("A65536").End(xlUp).Offset(1, 0).Row)
outplace.Range("A" & outrow).PasteSpecial xlPasteAll
End If
If wb.Name <> "PO Access" Then
wb.Sheets("sheet1").Range("B7:K36").Copy
outrow = WorksheetFunction.Max(8, outplace.Range("A65536").End(xlUp).Offset(1, 0).Row)
outplace.Range("A" & outrow).PasteSpecial xlPasteAll
End If
Range("A1").Select
Next wb
End Sub
Thanks for all your help.
Bookmarks