I am using the following code to create new sheets based on an bigger excell file. I would like to rename the files like "nameofthesheet_Vouchering Hours August 2022_YTD" for each sheet, currently I am only getting "nameofthesheet". How can I change the code in order to have it like this?
Sub Separar_guias()
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub