As you can see below I don't really understand how to error catch so well. the line that keeps giving me the error is if Range("G1").value = "Eaches" then. Try as I might I can't get the error handling code to get it to get out of the X loop. I would prefer to not use on error resume next and would rather use if err.number = 1004 and if err.number = 91 because those are the two known types of errors and if another type of error pops up I'd like to know about it.
anyone help with the error handling code?
![]()
Dim x As Integer For x = 1 To 100 Retry: Application.ScreenUpdating = True Application.ScreenUpdating = False On Error GoTo Retry If Err.number = 91 Then GoTo MoveRotations If Err.number = 1004 Then GoTo MoveRotations On Error GoTo Retry If Range("G1").Value = "Eaches" Then If Err.number = 91 Then GoTo MoveRotations If Err.number = 1004 Then GoTo MoveRotations Range("G3:G3000").DELETE Shift:=xlUp End If ' ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Call FormatBeforePrinting On Error GoTo Retry ActiveWorkbook.Close Save Next x
Bookmarks