Hi...
My following code works great Howver, how can I have the smae fumction without copying the VB code or the Formulas:
My following code works great Howver, how can I have the smae fumction without copying the VB code or the Formulas:
Code:
If Not WorksheetExists(NewSheetName, TWSWorkBook) Then
'Worksheet does not exist - Add
With ThisWorkbook.Sheets(NewSheetName)
.Copy after:=Sheets(Sheets.Count)
End With
Else
'Worksheet exists - Delete then Add
Application.DisplayAlerts = False
Sheets(NewSheetName).Delete
Application.DisplayAlerts = True
With ThisWorkbook.Sheets(NewSheetName)
.Copy after:=Sheets(Sheets.Count)
End With
End If