I'm currently designing macros to help set up carry over sheets within my business. The issue i have is that if the filter choice is not available then it just selects the one that is and copy's. How can i skip this section if nothing is available.
Here is my code
Sub Copy_RSVDustol_Into_VacAC()
Windows("Vac AC.xlsm").Activate
Sheets("RSV&Dustol").Select
Windows("Carry Over.xlsm").Activate
Sheets("Vac A").Select
ActiveSheet.ListObjects("Table6").Range.AutoFilter Field:=13, Criteria1:= _
"RSV / DUSTROL"
Range("A2:B100").Select
Selection.Copy
Windows("Vac AC.xlsm").Activate
Sheets("RSV&Dustol").Select
Range("A2").Select
ActiveSheet.Paste
Windows("Carry Over.xlsm").Activate
Range("D2:F100").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Vac AC.xlsm").Activate
Range("D2").Select
ActiveSheet.Paste
Columns("C:C").EntireColumn.AutoFit
Windows("Carry Over.xlsm").Activate
Sheets("Vac A").Select
ActiveSheet.ListObjects("Table6").Range.AutoFilter Field:=13
End Sub
Here is my code
Sub Copy_RSVDustol_Into_VacAC()
Windows("Vac AC.xlsm").Activate
Sheets("RSV&Dustol").Select
Windows("Carry Over.xlsm").Activate
Sheets("Vac A").Select
ActiveSheet.ListObjects("Table6").Range.AutoFilter Field:=13, Criteria1:= _
"RSV / DUSTROL"
Range("A2:B100").Select
Selection.Copy
Windows("Vac AC.xlsm").Activate
Sheets("RSV&Dustol").Select
Range("A2").Select
ActiveSheet.Paste
Windows("Carry Over.xlsm").Activate
Range("D2:F100").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Vac AC.xlsm").Activate
Range("D2").Select
ActiveSheet.Paste
Columns("C:C").EntireColumn.AutoFit
Windows("Carry Over.xlsm").Activate
Sheets("Vac A").Select
ActiveSheet.ListObjects("Table6").Range.AutoFilter Field:=13
End Sub
Last edited: