Sub filesave()
Dim bFileSaveAs As Boolean
bFileSaveAs = Application.Dialogs(xlDialogSaveAs).Show
If Not bFileSaveAs Then MsgBox "User cancelled", vbCritical
End Sub
This code works great for what I'm trying to do. Can you help me take it one step further. Is there a way to have a file name already in the saveas box that comes up. The file name I would like would come from 3 cells. A1_B1_C1 It is important to have the underscores between. I like this code because it gives the user the option to save it in a folder of their choice instead of a predefined one in a code.
Thanks!
Dim IntialName As String
Dim fileSaveName As Variant
InitialName = Range("A1") & "_" & Range("B1") & "_" & Range("C1")
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitialName, _
fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
MsgBox "Save as " & fileSaveName
End If
This code works great for what I'm trying to do. Can you help me take it one step further. Is there a way to have a file name already in the saveas box that comes up. The file name I would like would come from 3 cells. A1_B1_C1 It is important to have the underscores between. I like this code because it gives the user the option to save it in a folder of their choice instead of a predefined one in a code.
Thanks!
Application.Dialogs(xlDialogSaveAs) Range("A1").Text & "_" & Range("B1").Text & "_" & Range("C1").Text