Hi all,
How do I design a saving macro with these requirements?
1. cell A1: Client Name (such as ACME, Inc.)
2. cell A2: Contract Date (such as Nov 15, 2010)
3. cell A3: Initial of the sales rep (such as AJ, or BK)
4. the spreadsheet is to be saved as a pdf file.
I'd like to click on a button (macro enabled) so that the file name would be like "(client name) quote as of (date) by (sales rep).pdf". E.g. "ACME, Inc quote as of Nov 15, 2010 by AJ.pdf".
The following was from MS 2003 and I'm using MS 2007. It always gives me error warning
or not working at all.
FileSaved = True
Enter_Prospect_Name = ActiveSheet.Range("b11") & "_Quote_" & ActiveSheet.Range("g1")
fileSaveName = Application.GetSaveAsFilename(Enter_Prospect_Name, fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> "False" Then
ActiveWorkbook.SaveAs Filename:=fileSaveName, FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
End If
End Sub
Please help.
How do I design a saving macro with these requirements?
1. cell A1: Client Name (such as ACME, Inc.)
2. cell A2: Contract Date (such as Nov 15, 2010)
3. cell A3: Initial of the sales rep (such as AJ, or BK)
4. the spreadsheet is to be saved as a pdf file.
I'd like to click on a button (macro enabled) so that the file name would be like "(client name) quote as of (date) by (sales rep).pdf". E.g. "ACME, Inc quote as of Nov 15, 2010 by AJ.pdf".
The following was from MS 2003 and I'm using MS 2007. It always gives me error warning
or not working at all.
FileSaved = True
Enter_Prospect_Name = ActiveSheet.Range("b11") & "_Quote_" & ActiveSheet.Range("g1")
fileSaveName = Application.GetSaveAsFilename(Enter_Prospect_Name, fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> "False" Then
ActiveWorkbook.SaveAs Filename:=fileSaveName, FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
End If
End Sub
Please help.