sheet available?

  • Thread starter Thread starter JIM.H.
  • Start date Start date
J

JIM.H.

Hello,
How can I check if a sheet available in a workbook and if
not create it.
Thanks,
Jim.
 
One way

Sub ShtExists()
For Each sh In ActiveWorkbook.Sheets
If sh.Name = "Summary" Then
ShtEx = True
Exit For
End If
Next sh
If ShtEx <> True Then
Set NewSh = Worksheets.Add
NewSh.Name = "Summary"
Else: MsgBox "Sheet already exists"
End If
End Sub
 

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