Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
Excel to PDF
Sub SaveActiveSheetsAsPDF()
'Create and assign variables Dim saveLocation As String saveLocation = "C:\Users\marks\OneDrive\Documents\myPDFFile.pdf"
'Save Active Sheet(s) as PDF ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation
End Sub
Checking Spelling
Sub WorkBook_BeforeClose(Cancel As Boolean)
Sheet1.Cells.CheckSpelling
End Sub
Macro For Conditional Formatting
Sub MultipleConditionalFormattingExample()
Dim MyRange As Range
'Create range object
Set MyRange = Range(“A1:A10”)
'Delete previous conditional formats
MyRange.FormatConditions.Delete
'Add first rule
MyRange.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=100", Formula2:="=150"
MyRange.FormatConditions(1).Interior.Color = RGB(255, 0, 0)
'Add second rule
MyRange.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=100"
MyRange.FormatConditions(2).Interior.Color = vbBlue
'Add third rule
MyRange.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="=150"
MyRange.FormatConditions(3).Interior.Color = vbYellow
End Sub
https://docs.google.com/spreadsheets/d/11aUQam0Fw4gNKvNH-9GwHaXMzm1flZT1/edit?usp=sharing&ouid=102147228666396687493&rtpof=true&sd=true