Resolved Question: Need help with VBA/macro in Excel?
I don't know VBA much, although I can figure out what a macro is doing if I edit it, but don't know the correct syntax to write it. I have the following macro which selects two sheets, then saves as a pdf:
Sub PrintPDF()
'
' printpdf Macro
'
'
Sheets(Array("Investment Comp", "Flier")).Select
Sheets("Investment Comp").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub
which works but it saves the pdf in the same location as the Excel file and gives it the same name as the Excel file. I'd like it to stop when it gets to the save window and prompt for filename/location. How do I make it do that?
THANKS!
Thank you garbo7441 - it *almost* worked as suggested. I just made a couple of modifications as follows:
SaveName = InputBox("Enter file name", "File Name")
Sheets(Array("Investment Comp", "Flier")).Select
Sheets("Investment Comp").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
SaveName & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
I would like it to browse for location, but this will probably work for now unless someone comes up with a better solution. THANK YOU!
