Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That was interesting, thank you so much for all the comments. With me trying
to learn vb with excel the different approaches certainly gave me some good information. Thanks again BOB R "Charlie" wrote in message ... Not true. I do it all the time for simplicity sake. Never had a problem. I'm with Bob. P.S. See the "On Error GoTo 0" line? That resets it for abnormal error catching. "Joel" wrote: Errors should be reserved for Errors, not in place of good programming practices. Good programming practrices should not force an error on a normal condition. Errors should be reserved for abnormal condtions. "Bob Phillips" wrote: No need to loop Application.DisplayAlerts = False On Error Resume Next Worksheets("Rejected Voucher Statistics").Delete On Error GoTo 0 Application.DisplayAlerts = True -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Joel" wrote in message ... Sub test1() For Each wks In Worksheets If wks.Name = "Rejected Voucher Statistics" Then wks.Delete End If Next wks End Sub "LabrGuy Bob R" wrote: Hello, I have this listed in my code and it works fine when I remember to delete the sheet and it can be replaced. However there are times I don't succeed in getting to that place and hope I can get an answer. If the "Rejected Voucher Statistaics" sheet exists I need to delete the sheet from the workbook so the new "Pivot Table Sheet" can be moved seemlessly and named the same. I would like to 1. Iheck and see if it exists 2. If it doesn't continue 3. If it does exist, delete it and continue with the macro.. ActiveSheet.Name = "Rejected Voucher Statistics" Thanks BOBR |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA for deleting a sheet | Excel Programming | |||
Deleting sheet | Excel Programming | |||
Deleting a sheet | Excel Programming | |||
Deleting Sheet | Excel Programming | |||
Deleting a Sheet | Excel Programming |