Macro Help - check existing tabs

M

Macro Help

I have a macro that takes data from an existing tab,
creates a new tab called "Final", and does some
formatting stuff with it. An improvement I want to make
is to have the macro check the workbook at the beginning
to see if it already has an existing "Final" tab, and if
so, prompt the user whether to delete the existing tab or
quit the macro. How do I make this work?

Thank you
 
B

Bob Phillips

Dim oSheet As Worksheet

On Error Resume Next
Set oSheet = Worksheets("Sheet1")
On Error GoTo 0
If oSheet Is Nothing Then
Worksheets.Add.Name = "Sheet1"
End If
 
Top