Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to add a new workseet to the active workbook, but I need test for its
existence before I do. I used this: If WorksheetExists("BuildQueries.xls", "Queries") Then MsgBox ("sheet does exist") Else MsgBox ("sheet does NOT exist") End If with this function: Function WorksheetExists(WBName As String, WSName As String) As Boolean On Error Resume Next WorksheetExists = _ (Workbooks(WBName).Worksheets(WSName).Name = WSName) End Function It works fine, but the name of the file may not always be "BuildQueries.xls". What do I need to use in place of "BuildQueries.xls" in the function call to WorksheetExists to make it reference the active workbook? Thanks, Ken Loomis |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to copy active worksheet to new workbook | Excel Discussion (Misc queries) | |||
Testing for existence of a formula | Excel Worksheet Functions | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions | |||
Copy worksheet from Active workbook into all other open workbooks | Excel Programming | |||
Testing for existence of range | Excel Programming |