Hoping I can get some help with this, quite new to VBA and loving what it can do !
I have this bit of code below which will save 2 sheets into 1 PDF:
My problem is in reference to the filename:="H:\Desktop\Test" & ".pdf" above. Can someone please teach me how I can, instead of defining the file and location, allow the user to select it themselves via a 'Save As' ? I have found a few guides on how to do this but I just can't seem to get it work.
Many thanks
I have this bit of code below which will save 2 sheets into 1 PDF:
VBA Code:
Sub CompileReport()
Dim mySheets As Variant, sh
Dim filename As Variant
mySheets = Array("Print User", "Print Checklist")
For Each sh In mySheets
Sheets(sh).PageSetup.Orientation = xlLandscape
Sheets(sh).PageSetup.FitToPagesWide = 1
Next
Sheets(mySheets).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:="H:\Desktop\Test" & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False
Sheets("Print User").Visible = False
Sheets("Print Checklist").Visible = False
End Sub
My problem is in reference to the filename:="H:\Desktop\Test" & ".pdf" above. Can someone please teach me how I can, instead of defining the file and location, allow the user to select it themselves via a 'Save As' ? I have found a few guides on how to do this but I just can't seem to get it work.
Many thanks