HI i have 2 macros that copy and paste data from multiple sheets to one single sheet.
the issue is that "CopyDPDData" works fine but the "CopyScanData" only copies the one sheet -MON_SCAN and ignores "TUES_SCAN" (Will be expanding to all days of the week if i can get it to work).
As far as i can see the code is exacly the same but with the sheet names changed .
hope it is something obvious but i cannot see it.
the issue is that "CopyDPDData" works fine but the "CopyScanData" only copies the one sheet -MON_SCAN and ignores "TUES_SCAN" (Will be expanding to all days of the week if i can get it to work).
As far as i can see the code is exacly the same but with the sheet names changed .
hope it is something obvious but i cannot see it.
VBA Code:
Sub CopyScanData()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In Worksheets
If ws.Name <> "MON_DPD" And ws.Name <> "TUES_DPD" And ws.Name <> "SUMMARY" And ws.Name <> "WEEKLY" And ws.Name <> "WEEKLY_SCAN" And ws.Name <> "WEEKLY_DPD" Then
ws.Range("A1:C5000").Copy
Worksheets("WEEKLY_SCAN").Cells(Cells.Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
End If
Next ws
Rows("1:1").Select
Selection.Delete Shift:=xlUp
End Sub
Sub CopyDPDData()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In Worksheets
If ws.Name <> "MON_SCAN" And ws.Name <> "TUES_SCAN" And ws.Name <> "SUMMARY" And ws.Name <> "WEEKLY" And ws.Name <> "WEEKLY_SCAN" And ws.Name <> "WEEKLY_DPD" Then
ws.Range("A1:Q5000").Copy
Worksheets("WEEKLY_DPD").Cells(Cells.Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
End If
Next ws
Rows("1:1").Select
Selection.Delete Shift:=xlUp
End Sub