Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code which is supposed to enter a new worksheet,
rename it "Working Template" and do other stuff. There is an error check that is supposed to flag the error that occurs if a "Working Template" sheet already exists - then delete the current (newly added) sheet and the "Working Template", then go back to the beginning. For some reason, though, it's just not working at all. I wrote the code on another computer and had no problems, but on this machine it refuses to catch it. I could rewrite it to circumvent the problem, but it is happening elsewhere too, so i would like to get a better understanding of why. Any advice or recommendations would be greatly appreciated. Function () beginning: Sheets.Add After:=Sheets(6) On Error GoTo error_occured Sheets(7).Name = "Working Template" Sheets(6).Cells.Copy Sheets(7).Select With Selection .PasteSpecial Paste:=xlPasteValues .PasteSpecial Paste:=xlPasteFormats End With Cells.UnMerge Exit Function error_occured: Application.DisplayAlerts = False ActiveSheet.Delete Sheets("Working Template").Delete Application.DisplayAlerts = True Resume beginning End Function Thanks, Thedude |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error Goto ... Error | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
ON Error goto fails on 2nd error | Excel Programming | |||
On Error GoTo | Excel Programming | |||
How can I still go to the error-code after a On Error Goto? | Excel Programming |