Project 2 - Create a report using PowerQuery, Macro VBA, List Functions and Data Validation functions for Data Reporting of Supply Chain Management companies
- Create VBA Code to convert selected data into pdf from applicant data
- Press Alt + F11 to open the Visual Basic for Applications (VBA) editor.
- In the VBA editor, go to Insert > module to insert a new module
Check Spelling mistakes in the workbook using VBA Code
= Sub CheckSpellingMistakes()
Dim ws As Worksheet
Dim cell As Range
' Loop through all worksheets in the workbook
For Each ws In ThisWorkbook.Worksheets
ws.Activate
' Loop through all cells with text in the worksheet
For Each cell In ws.UsedRange.SpecialCells(xlCellTypeConstants, xlTextValues)
' Ignore formulas and empty cells
If Not cell.HasFormula And Len(Trim(cell.Value)) > 0 Then
' Check spelling for the cell's value
If Application.CheckSpelling(word:=cell.Value) = False Then
' If spelling mistake found, highlight the cell
cell.Interior.Color = RGB(255, 0, 0) ' Red color
Else
' If no spelling mistake, remove any previous highlighting
cell.Interior.Pattern = xlNone
End If
End If
Next cell
Next ws
End Sub