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 ApplyConditionalFormattingAndFreezePanes()
' Apply conditional formatting to the desired range
With Range("A1:D10") ' Replace with your desired range
.FormatConditions.AddColorScale ColorScaleType:=3
.FormatConditions(.FormatConditions.Count).SetFirstPriority
.FormatConditions(1).ColorScaleCriteria(1).Type = xlConditionValueLowestValue
.FormatConditions(1).ColorScaleCriteria(1).FormatColor.Color = RGB(255, 0, 0)
.FormatConditions(1).ColorScaleCriteria(2).Type = xlConditionValueHighestValue
.FormatConditions(1).ColorScaleCriteria(2).FormatColor.Color = RGB(0, 255, 0)
End With
' Freeze the desired panes
With ActiveWindow
.SplitColumn = 1 ' Replace with the desired column to split
.SplitRow = 2 ' Replace with the desired row to split
.FreezePanes = True
End With
End Sub
2)Sub ConvertSelectedDataToPDF()
Dim ws As Worksheet
Dim rng As Range
Dim filePath As String
Set ws = ActiveSheet ' Replace with the desired worksheet
Set rng = Selection ' Replace with the desired range
filePath = "C:\Path\to\save\file.pdf" ' Replace with the desired file path and name
rng.ExportAsFixedFormat Type:=xlTypePDF, Filename:=filePath, Quality:=xlQualityStandard
End Sub
3)Sub CheckSpellingMistakes()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Activate
Cells.CheckSpelling
Next ws
End Sub.
link: https://docs.google.com/spreadsheets/d/1IXd3NxoB38AJf6Q-z1kOosxcSKxfOW1M/edit?usp=drive_link&ouid=110986998712290508303&rtpof=true&sd=true