Try this:
Option Explicit
Sub Macro1()
Dim ws As Worksheet
Dim strTabName As String
Application.ScreenUpdating = False
On Error Resume Next
Set ws = ThisWorkbook.Sheets(CStr(Format(Date, "mm-dd-yy")))
On Error GoTo 0
If Not ws Is Nothing Then
strTabName = Application.InputBox("There is already a tab called """ & Format(Date, "mm-dd-yy") & """ in the workbook." & vbNewLine & "Please enter a different name:", "Tab Name Editor")
If strTabName = "False" Then
Application.ScreenUpdating = True
Exit Sub
End If
Set ws = Nothing
End If
ActiveSheet.Copy After:=Sheets(Sheets.Count)
Set ws = Sheets(Sheets.Count)
ws.Name = IIf(Len(strTabName) > 0, strTabName, Format(Date, "mm-dd-yy"))
Application.ScreenUpdating = True
End Sub
Bookmarks