Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
An error on the error :)
On Error Resume Next
Sheets("EMPLOYEE").Delete Sheets("ALLSALES").Delete On Error GoTo 0 Regards Trevor "Teggaman" wrote in message om... try this instead On Error GoTo 777 Sheets("EMPLOYEE").Select ActiveWindow.SelectedSheets.Delete 777: On Error GoTo 0 on error goto end_error end_error Sheets("ALLSALES").Select ActiveWindow.SelectedSheets.Delete goto end_error 888: resume 777 end_error: end sub "Paul" wrote in message ... I want VB to delete two sheets if they exist. In the following example, neither sheet exists. VB handles the missing EMPLOYEE fine, but then crashes when it hits the missing ALLSALES. Why? On Error GoTo 777 Sheets("EMPLOYEE").Select ActiveWindow.SelectedSheets.Delete 777: On Error GoTo 0 On Error GoTo 888 Sheets("ALLSALES").Select ActiveWindow.SelectedSheets.Delete 888: On Error GoTo 0 TIA Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 - error saving file & error loading dll | Excel Discussion (Misc queries) | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
I have Error 1919 Error Configuring ODBC dataSource Database | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |