Excel 2003 - VBA - Recognition of worksheets

  • Thread starter Thread starter C Brandt
  • Start date Start date
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top