Good morning,
Currently I this code below to create from sheet 5 some Excel files with same name at sheet. However I would like to add current date as: "List AA 30.03.2022".
Sub EXCELS()
'Create excel files
Dim i As Integer
Dim name_file As String
For i = 5 To Sheets.Count
name_file = Sheets(i).Name
Worksheets(i).Copy
With ActiveWorkbook
.SaveAs Filename:=ThisWorkbook.Path & "\" & name_file & ".xlsx",
FileFormat:=xlOpenXMLWorkbook
.Close SaveChanges:=False
End With
Next i
End Sub
What do I need to add?
>Solution :
Try this :
ThisWorkbook.Path & "\" & name_file & " " & Format(Date, "DD.MM.YYYY") & ".xlsx"