Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I'm trying to check to see if a sheet named "Test Matrix" exists in any
open excel file. I would also like my macro to copy this worksheet if it isn't in the current workbook that the macro was run from. This is the code I found in the newsgroups so far which is a start. Thanks in advance! Public Function WSExist(wsname As String) As Boolean 'returns true if worksheet exists in the active workbook Dim objWorksheet As Object On Error Resume Next WSExist = False Set objWorksheet = ActiveWorkbook.Sheets(wsname) If Err = 0 Then WSExist = True End Function Sub TestMatrix_Chk() If WSExist("Test Matrix") = False Then MsgBox ("No Test Matrix sheet found!") End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can't open existing files by double-clicking. | Excel Discussion (Misc queries) | |||
It takes two full minutes to open existing files in Office 2003 | Excel Discussion (Misc queries) | |||
When I open a an existing excel worksheet, it duplicates itself a. | Excel Discussion (Misc queries) | |||
Open only existing Excel Files in a given Range | Excel Programming | |||
Open only existing Excel Files in a given Range | Excel Programming |