Below is a snppet of VBA code I am using to move data from one excel file to another. It works fine until it gets to the code in bold and underlined. Instead of pulling the data from the "Block_Check" workbook as the lines above it do, it instead pulls
it from the "Cancelled OB" workbook referenced in the next set of code. How do I fix this?
Set wb = Workbooks("DC Reporting.xlsx")
Set wb6000 = Workbooks("DC Reporting.xlsm")
rws = wb6000.Sheets("Profit Hold").Cells(Rows.Count, 1).End(xlUp).Row + 1
With wb.Sheets("Block_Check")
na = .Cells(Rows.Count, 1).End(xlUp).Row - 1
'A36->A2
.Cells(36, 1).Resize(na, 3).Copy Destination:=wb6000.Sheets("Profit Hold").Cells(2, 1)
'D36->E2
.Cells(36, 4).Resize(na, 4).Copy Destination:=wb6000.Sheets("Profit Hold").Cells(2, 5)
'H36->J2
.Cells(36, 8).Resize(na, 1).Copy Destination:=wb6000.Sheets("Profit Hold").Cells(2, 10)
End With
Set wb = Workbooks("DC Reporting.xlsx")
Set wb6000 = Workbooks("DC Reporting.xlsm")
rws = wb6000.Sheets("Cancelled OBs").Cells(Rows.Count, 1).End(xlUp).Row + 1
With wb.Sheets("Cancelled OB")
na = .Cells(Rows.Count, 1).End(xlUp).Row - 1
'A36->A2
.Cells(36, 1).Resize(na, 3).Copy Destination:=wb6000.Sheets("Profit Hold").Cells(2, 1)
'B36->C2
.Cells(36, 2).Resize(na, 9).Copy Destination:=wb6000.Sheets("Profit Hold").Cells(2, 3)
End With
Thanks,
Shelli