Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error handling with a handling routine | Excel Programming | |||
error handling | Excel Programming | |||
Error Handling | Excel Programming | |||
Error handling | Excel Programming | |||
Error Handling | Excel Programming |