The codes below allows me to save the active worksheet into a new workbook using the active worksheet tab name. My question is I like to save the selected sheets with a new name instead of just one sheet which the code below is doing.
Code:
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