LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Error Handling

We are inserted selected sheets into a workbook. Some of the sheets are to
reference others if the others have been inserted. I have some code that is
supposed to skip to a label if a referenced sheet has not been added to the
workbook.

It does not work. Can you tell me why?

When testing the code, the Steel sheet is present and the Joists and
Deck Erect sheets are not. The code works fine until it tries to select
the Deck Erect sheet. The program stops with Subscript out of range.

I have tried Resume 295 (which is the next line of code) but get a
Compile Error Label not defined.


Sub SetErectRecapRanges()

Sheets("Erect Recap").Select

< some code to name ranges

On Error GoTo SkipSteel
Sheets("Steel").Select If sheet Steel does not exist, code is to
resume at SkipSteel:
Sheets("Erect Recap").Select

< some code to reference the Steel sheet in the Erect Recap sheet

SkipSteel:
On Error GoTo 0
On Error GoTo SkipJoists
Sheets("Joists").Select If sheet Joists does not exist, code is
to resume at SkipJoists:
Sheets("Erect Recap").Select

< some code to reference the Joists sheet in the Erect Recap sheet

SkipJoists:
On Error GoTo 0
On Error GoTo SkipDeck
Sheets("Deck Erect").Select If sheet Deck Erect does not exist,
code is to resume at SkipDeck:
Sheets("Erect Recap").Select

< some code to reference the Deck Erect sheet in the Erect Recap sheet

SkipDeck:
On Error GoTo 0
Range("A1").Select
End Sub


Your assistance is appreciated.

Thank you.
--
Don
 
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
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
error handling jeffP Excel Programming 1 July 3rd 04 06:10 PM
Error Handling Todd Excel Programming 1 February 13th 04 11:29 PM
Error handling Tim C Excel Programming 1 October 7th 03 10:00 PM
Error Handling Rob Bovey Excel Programming 0 August 7th 03 12:11 AM


All times are GMT +1. The time now is 10:06 PM.

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

About Us

"It's about Microsoft Excel"