PDA

View Full Version : save as with auto name



mykal66
07-19-2011, 11:26 AM
The code below works to autoname a file based on certain cells within a worksheet but rather than save in the background is it possible to bring up the save as dialogue box with the file name already populated?
Sub Save()

Sheets("Letter Creation").Select
Range("c3").Select
a = ActiveCell.Value
Range("c5").Select
b = ActiveCell.Value
Range("b16").Select
c = ActiveCell.Value

q3 = a & " " & b & " " & "(" & c & " " & d

ActiveWorkbook.SaveAs Filename:=q3 & Format(Date, "mmmm dd yyyy") & ")" & ".xls"

End Sub


Thanks

CatDaddy
07-19-2011, 03:47 PM
Sub Save()



Sheets("Letter Creation").Select
Range("c3").Activate
a = ActiveCell.Value
Range("c5").Activate
b = ActiveCell.Value
Range("b16").Activate
c = ActiveCell.Value


q3 = a & " " & b & " " & "(" & c & " " & d

Dim chk as Integer
chk = InputBox(q3 & Format(Date, "mmmm dd yyyy") & ")" & ".xls" & vbCrLf & "1) Save" & vbCrLf & "2) Abort")
if chk = 1

ActiveWorkbook.SaveAs Filename:=q3 & Format(Date, "mmmm dd yyyy") & ")" & ".xls"
End If


End Sub

frank_m
07-20-2011, 12:11 AM
'.........

Application.Dialogs(xlDialogSaveAs).Show _
("C:\YourFolder\" & q3 & " (" & Format(Date, "mmmm dd yyyy") & ")" & ".xls")