I have a file. after inporting the data from another source i need to save as
Exising name of the file & "All" & yesterday date
Please look at my code and help me find out what is wrong with that, please
Private Sub GetSaveAsName()
Dim file_name As Variant
' Get the file name.
file_name = Application.GetSaveAsFilename( _
FileFilter:="Excel Files,*.xls,All Files,*.*", _
Title:="Save As File Name")
' See if the user canceled.
If file_name = False Then Exit Sub
' Save the file with the new name.
If LCase$(Right$(file_name, 4)) <> ".xls" Then
file_name = file_name & ".xls"
ActiveWorkbook.SaveAs Filename:=file_name & " All" & Format(Now, "mm/dd/yy") - 1