Hello,
I need some basic advice on what to do when my VBA code runs into errors..
I have this bit of code to delete sheets tabs
Formula:
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("AREAS").Range("A2")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
Application.DisplayAlerts = False
Sheets(MyCell.Value).Delete
Application.DisplayAlerts = True
Next MyCell
When the sheet tabs are not there to delete I want it to not come up with an error.
I thought the code would be something like on error do nothing
Can someone help with what to put that I could use in other code too to just make the code not error and whether to put the code where the error occurs or at the end?
Thanks in advance to anybody who can assist
Bookmarks