Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I check for the existance of a worksheet in my workbook...if it exists
I want to delete it. I run through a list of sheet names and delete them if they exist. This works.... e.g. getting a positive response that the sheet exists. But I am also getting a positive response when the sheet does not exist. Dim SheetExists As Boolean For n = 1 To 6 On Error Resume Next SheetExists = Sheets(sheetname(n)).name = sheetname(n) On Error GoTo 0 If SheetExists Then ' delete it if it exists" Sheets(sheetname(n)).Select Application.DisplayAlerts = False Worksheets(sheetname(n)).Delete Application.DisplayAlerts = True Else ' do nothing End If Next n |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and move check box (check boxes) with new cell link? | Excel Worksheet Functions | |||
Reimport XML fails | Excel Discussion (Misc queries) | |||
Increase size of a Forms Check Box (click on to enter check mark) | Excel Discussion (Misc queries) | |||
Check if Conditional Format is True or False / Check cell Color | Excel Worksheet Functions | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) |