Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 10:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"