Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
VBA code To convert the data into pdf
Sub PrintSelectiontoPDF()
Dim ThisRng As Range
Dim strfile As String
Dim myfile As Variant
If Selection.Count = 1 Then
Set ThisRng = Application.InputBox("Selete a range","Get Range",Tpye:=8)
Else
Set ThisRng = Selection
End If
strfile = "Selection" & "_" _ & Format(Now(),"yyyymmdd_hhmmss") _ & ".pdf"
myfile = Application.GetSaveAsFilename _
If myfile <> "False" Then
'save as pdf
ThisRng.ExportAsFixedFormat Type:= _ myfile,
Quality:=xlQualityStandard,IncludeDocProperties:=True,_
IgnorePrintAreas:=False,
OpenAfterPublish:=True
Else
MsgBox"No File Selected.PDF will not be saved",vbOKOnly,"No File Selected"
End if
End sub
VBA Code to check spelling mistake in Workbook
Sub SpellCheck()
For Each sh In Worksheets
Sheets(sh.Name).Cells.CheckSpelling
Next
End Sub