If you want to learn the Excel VBA Macros and want to become a professional, enroll in our course
📄 Download Attached File *Example VBA Macro
vba
Copy
Edit
Sub HighlightTop10()
' Highlights top 10 values in column A
Dim cell As Range
For Each cell In Range("A1:A100")
If cell.Value >= Application.WorksheetFunction.Large(Range("A1:A100"), 10) Then
cell.Interior.Color = RGB(255, 255, 0) ' Yellow
End If
Next cell
End Sub
VBA Macros (Visual Basic for Applications Macros) are small programs written in the VBA language to automate tasks in Microsoft Office applications like Excel, Word, and PowerPoint.