Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i am trying to write a macro, however i need to know if a worksheet exist
within a file that has been opened before the macro continues, |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Chip Pearson posted this function:
Function WorksheetExists(SheetName As Variant, _ Optional WhichBook As Workbook) As Boolean 'from Chip Pearson Dim WB As Workbook Set WB = IIf(WhichBook Is Nothing, ThisWorkbook, WhichBook) On Error Resume Next WorksheetExists = CBool(Len(WB.Worksheets(SheetName).Name) 0) End Function 'and you can use it like: .... if worksheetexists("myname",activeworkbook) then application.displayalerts = false worksheets("Myname").delete application.displayalerts = true end if harish wrote: i am trying to write a macro, however i need to know if a worksheet exist within a file that has been opened before the macro continues, -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Weird File Open/Save As Behavior | Excel Discussion (Misc queries) | |||
Indirect formula using Data Validation List of Worksheet Tabs | Excel Worksheet Functions | |||
find names on list 1 in list 2. list 1 4000 names list 2 400 name | Excel Worksheet Functions | |||
Search a worksheet, extract rows using a list from another sheet | Excel Discussion (Misc queries) | |||
Create a list in one worksheet of the other worksheets' names | Excel Worksheet Functions |