Hi Everyone, I've been working on a script which includes the below as the end command for saving the file as XLSX from XLSM. However, is there anyway this could be altered so that it picks up the the name of the file from cell "D3" of tab "Lead Sheet" & also adds in a constant at the end. So the file name should automatically be populated on the saveas window before saving to a desired location.
file name: "Cell D3_2021 WB_Client Copy"
Cell D3 from tab "Lead Sheet"
Thanks for your help in advance.
Dim save_as As Variant
Dim file_name As String
Dim ProgramName As String
file_name = ProgramName
' Get the file name.
save_as = Application.GetSaveAsFilename(file_name, _
FileFilter:="Excel Files,*.xlsx,All Files,*.*")
' See if the user canceled.
If save_as = False Then Exit Sub
' Save the file with the new name.
Application.DisplayAlerts = False
If LCase$(Right$(save_as, 4)) <> ".xlsx" Then
file_name = save_as & ".xlsx"
End If
ActiveWorkbook.SaveAs filename:=save_as, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
file name: "Cell D3_2021 WB_Client Copy"
Cell D3 from tab "Lead Sheet"
Thanks for your help in advance.
Dim save_as As Variant
Dim file_name As String
Dim ProgramName As String
file_name = ProgramName
' Get the file name.
save_as = Application.GetSaveAsFilename(file_name, _
FileFilter:="Excel Files,*.xlsx,All Files,*.*")
' See if the user canceled.
If save_as = False Then Exit Sub
' Save the file with the new name.
Application.DisplayAlerts = False
If LCase$(Right$(save_as, 4)) <> ".xlsx" Then
file_name = save_as & ".xlsx"
End If
ActiveWorkbook.SaveAs filename:=save_as, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False