Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
https://docs.google.com/spreadsheets/d/1GPxOiFUSr2rUPOqJNsvh2VGnggShX_xH/edit?usp=drive_link&ouid=114937887212072578920&rtpof=true&sd=true
Other deliverables
Ans-1
A-Sub ConditionalFormatting() ‘Define Range Dim MyRange As Range Set MyRange = Range(“A1:A10”) ‘Delete Existing Conditional Formatting from Range MyRange.FormatConditions.Delete ‘Apply Conditional Formatting MyRange.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _ Formula1:="=100", Formula2:="=150" MyRange.FormatConditions(1).Interior.Color = RGB(255, 0, 0) End Sub
B-Sub FreezeCertainPanes() With ActiveWindow If .FreezePanes Then .FreezePanes = False .SplitColumn = 0 .SplitRow = 1 .FreezePanes = True End With End Sub
ANS-02
Sub PrintSelectionToPDF() 'SUBROUTINE: PrintSelectionToPDF 'DEVELOPER: Ryan Wells 'DESCRIPTION: Print your currently selected range to a PDF Dim ThisRng As Range Dim strfile As String Dim myfile As Variant If Selection.Count = 1 Then Set ThisRng = Application.InputBox("Select a range", "Get Range", Type:=8) Else Set ThisRng = Selection End If
'Prompt for save location strfile = "Selection" & "_" _ & Format(Now(), "yyyymmdd_hhmmss") _ & ".pdf" strfile = ThisWorkbook.Path & "\" & strfile myfile = Application.GetSaveAsFilename _ (InitialFileName:=strfile, _ FileFilter:="PDF Files (*.pdf), *.pdf", _ Title:="Select Folder and File Name to Save as PDF") If myfile <> "False" Then 'save as PDF ThisRng.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ 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
Ans-3
Sub SpellCheckInActiveSheet()
ActiveSheet.CheckSpelling
End Sub