Hi,
False Then MsgBox "Save as " & save_name End If End Sub>
have the code below how can I modify it that can use the value in cell A105 as the file name.
Code:
Sub Save_Workbook_NewName()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
' Change initial folder as needed or store it in a cell and reference that
fd.InitialFileName = "\mtlnas01EFT_backup2021"
'fd.AllowMultiSelect = True
FilePicked = fd.Show
ActiveSheet.Shapes("Button 13").Delete
ActiveSheet.Shapes("Button 15").Delete
ActiveSheet.Shapes("Button 17").Delete
ActiveSheet.Shapes("Button 19").Delete
ActiveSheet.Shapes("CommandButton1").Delete
Worksheets("USD_WIRES").Range("A1").ClearComments
Worksheets("USD_WIRES").Range("J1").ClearComments
Worksheets("USD_WIRES").Range("K1").ClearComments
save_name = Application.GetSaveAsFilename(fileFilter:="Excel File (*.xlsx), *.xlsx")
ActiveWorkbook.SaveAs Filename:=save_name, FileFormat:=51
[COLOR=rgb(184, 49, 47)]ThisWorkbook.SaveAs Range("A1"), 51 [/B][/COLOR]
If save_name <> False Then
MsgBox "Save as " & save_name
End If
End Sub
Thank you,
Try:
save_name=Activesheet.Range("A105").Value
Make sure cell A105 has the extension as well, not just the complete file path, if not, add it:
save_name=Activesheet.Range("A105").Value & ".xlsx"
Thank you, Catalin.
I'll test it and let you know.
Hi Catalin,
Question
I used your suggestions to save the file
save_name=Activesheet.Range("A105").Value but can't figure out how to put in cell a105 to put the complete file path in the formula.
Any suggestion.
Thank you
how to put in cell a105 to put the complete file path in the formula.
What formula you have in A105?
And where is the folder location?
Hi,
is the information:
Formula placed on cell "A88": =" "&O1&" "&A78&" NCL USD Wires Summary "&TEXT(A2,"MMMM DD, YYYY")&""
Formula results: 330 4 NCL USD Wires Summary November 18, 2021
Location: "\mtlnas01EFT_backup2021"
thank you,
I don't understand the problem, looks like you know how to join pieces of text together.
Why not adding the location to your formula:
="\mtlnas01EFT_backup2021"&O1&" "&A78&" NCL USD Wires Summary "&TEXT(A2,"MMMM DD, YYYY")&".xlsx"
thank you.