Can anyone help me with this?
I have this code below, which I thought would print out the sheets that exist, but I keep getting an error when they aren't there.
If all the sheets in the array exist, it works perfectly.
Is there a way to only print what is there and not have an error if they aren't?
Sub test()
Sheets("Batch3").Select
If Range("b2") <> "" Then
For Each wks In Worksheets(Array("Batch3", "TESTER (57)", "TESTER (58)", "TESTER (59)", "TESTER (60)", "TESTER (61)", "TESTER (62)", "TESTER (63)", "TESTER (64)", "TESTER (65)", "TESTER (66)", "TESTER (67)", "TESTER (68)", "TESTER (69)", "TESTER (70)", "TESTER (71)", "TESTER (72)", "TESTER (73)", "TESTER (74)", "TESTER (75)", "TESTER (76)", "TESTER (77)", "TESTER (78)", "TESTER (79)", "TESTER (80)", "TESTER (81)", "TESTER (82)", "TESTER (83)", "TESTER (84)"))
If SH.Visible = xlSheetVisible Then
SH.PrintOut Copies:=1, Collate:=True
Else: MsgBox "Batching Complete, 2 batches printed", vbOKOnly
End If
Next
Bookmarks