Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
1.
Sub SaveRangeAsPDF()
'Create and assign variables
Dim saveLocation As String Dim ws as Worksheet
Dim rng As Range
saveLocation = "C:\Users\marks\OneDrive\Documents\myPDFFile.pdf"
Set ws = Sheets("Sheet1")
Set rng = ws.Range("A1:H20")
'Save a range as PDF
rng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation
End Sub
2.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet1.Cells.CheckSpelling
End Sub