Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using the code below to find out if a worksheet named "Memo" exists in the active workbook. If the code find a worksheet named "Memo"... it returns True. It's working great..but now I need to change the code to find out if there are any worksheets in the active workbook that start with the name "Memo" There can be many worksheets with the name "Memo" added to this file....and appear as... Memo, Memo(2), Memo (3) and so on... I'm not sure what needs to be changed in this code to do this.. Public Function WSExist(Memo 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("Memo") If Err = 0 Then WSExist = True End If End Function Any help is greatly apprecaited.. Thanks in advance! Kimberly :) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Exists? Invisible Worksheets? | Excel Programming | |||
Help with code that checks if a sheet exists | Excel Programming | |||
Printing multiple worksheets only if data exists | Excel Programming | |||
Need code to protect worksheets - amount of worksheets varies | Excel Programming | |||
If Worksheets("Test") Exists Then Delete It | Excel Programming |