JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
Exploring the use of Error handling in VBA and stuck with following:
I would like the macro to delete the worksheet "Exceptions" if no exceptions are found, otherwise carry on with the rest of the macro WITHOUT deleting the worksheet "Exceptions"
I've tried modifying the last two codes of line above to:
but the line myContinue is always exceuted, regardless of whether the Error is found (i.e. the item to find is found or not)
Please can someone enlighten me?
Thanks in advance,
Jack
Exploring the use of Error handling in VBA and stuck with following:
Code:
On Error GoTo myContinue
'code here to find an item and cut & paste it into a previously created worksheet "Exceptions"
'a flag to highlight if exceptions found which is called upon later in the macro
NoExceptionsFlag = False
myContinue: Worksheets("Exceptions").delete
I would like the macro to delete the worksheet "Exceptions" if no exceptions are found, otherwise carry on with the rest of the macro WITHOUT deleting the worksheet "Exceptions"
I've tried modifying the last two codes of line above to:
Code:
myContinue: NoExceptionsFlag = False
If Not NoexceptionsFlag Then: Worksheets("Exceptions").delete
but the line myContinue is always exceuted, regardless of whether the Error is found (i.e. the item to find is found or not)
Please can someone enlighten me?
Thanks in advance,
Jack