Excel 2003 - VBA - Recognition of worksheets

C

C Brandt

In order to keep the size of some of my workbooks down, I am deleteing
worksheets after the user is through with them.
This causes a problem when I go to generate the worksheets as they may
already be present.

How can I check to see if worksheets are present?

I'm guessing that this is really simple but I cannot find it in my
references.

Thanks,

Craig
 
B

Bob Phillips

Something like this

Dim sh As Worksheet

On Error Resume Next
Set sh = Worksheets("Sheet1")
On Error GoTo 0
If Not sh Is Nothing Then
MsgBox "Sheet already exists"
End If


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Top