Hi,
i have one excel-file and i have more sheet.
I have one sheet named "DS".
It's possible know if the sheet named "DS" exist in my workbook?
For Each Sheet In Sheets
If Sheet.Name = "DS" Then
MsgBox "Found Sheet DS"
SheetFound = True
End If
Next
If SheetFound = False Then
MsgBox "Sheet DS not found."
End If
End Sub
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
To know more immediate, you would have try renaming another sheet to the same name in the wb. But it may be easier with jebenson's code, as it is not restricted to any particular workbook.
your workbook (say MyBook) has a collection .Sheets
loop through the collection and test for name
I can't remember the code exactly but:
function isfound as boolean
isfound = false
for ic = 0 to mybook.sheets.count
if mybook.sheets(ic).name = "DS" the isfound = true
next ic
exit function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.