Dim myPath As String, NewName As String, ws As Worksheet
myPath = ThisWorkbook.Path
NewName = ActiveSheet.Name
Application.DisplayAlerts = False
For Each ws In Sheets
ws.Visible = True
If ws.Name <> NewName Then ws.Delete
Next
ThisWorkbook.SaveAs NewName & ".xls"
Sub exportwksht()
Dim myPath As String, NewName As String, ws As Worksheet
myPath = ThisWorkbook.Path
NewName = ActiveSheet.Name
Application.DisplayAlerts = False
For Each ws In Sheets
On Error Resume Next
If ws.Name <> NewName Then ws.Delete
Next ws
On Error GoTo 0
Application.DisplayAlerts = True
ThisWorkbook.SaveAs NewName & ".xls"
End Sub