Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
https://drive.google.com/file/d/1xh0CeoPrXY8kMlCSizqqnqxU8z5Zch-n/view?usp=sharing
VBA Code - Convert to PDF
Public Sub Convert_To_PDF()
Dim ws As Worksheet
Dim rng As Range
Dim savePath As String
Dim pdfFileName As String
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to the name of your worksheet
Set rng = ws.Range("A1:D10") ' Change this range to the desired range
savePath = ThisWorkbook.Path & Application.PathSeparator ' Saves the PDF in the same folder as the Excel file
pdfFileName = "ApplicantData.pdf" ' Change to your desired PDF file name
With rng
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=savePath & pdfFileName, Quality:=xlQualityStandard
End With
MsgBox "Applicant data has been converted to PDF and saved as " & pdfFileName, vbInformation
End Sub
Spelling Check VBA Code
Public Sub Spelling_Check()
Dim ws As Worksheet
Dim cell As Range
For Each ws In ThisWorkbook.Worksheets
For Each cell In ws.UsedRange
If Not Application.CheckSpelling(word:=cell.Value) Then
cell.Interior.Color = RGB(255, 0, 0) ' Highlight cell with red if a mistake is found
Else
cell.Interior.ColorIndex = xlNone ' Clear the highlight if spelling is correct
End If
Next cell
Next ws
End Sub