Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
https://1drv.ms/x/s!AkSK96vKX3gUik9Nu8UaQkZGF_G6
Sub ExportToPDF()
Dim ws As Worksheet
Dim saveLocation As String
Set ws = ActiveSheet
'Get save location from user
saveLocation = Application.GetSaveAsFilename(InitialFileName:=ws.Name, FileFilter:="PDF Files (*.pdf), *.pdf")
'Check if user cancelled or entered invalid filename
If saveLocation = "False" Or saveLocation = "" Then
MsgBox "Export cancelled."
Exit Sub
End If
'Export selected range to PDF
ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=saveLocation, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox "Export complete."
End Sub