» Set up conditional formatting for an area with VBA in Microsoft Excel
CATEGORY - Formating in VBA
VERSION - All Microsoft Excel Versions
In the selected area, the maximum value is to be marked violet with a conditional formatting
Answer:
Enter following code in a standard module.
Sub ConditionalFormat()
With Selection
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=" & Range("Field").Cells(1).Address(False, False) & _
"=MAX(" & Selection.Address & ")"
.FormatConditions(1).Interior.ColorIndex = 39
End With
End Sub
Book Store:
Recommended Books:
- What the IRS Doesn't Want You to Know: A Cpa Reveals the Tricks of the Trade
- The South Beach Diet: The Delicious, Doctor-Designed, Foolproof Plan for Fast and Healthy Weight Loss
- Marketing Planning for Services
- Microsoft Outlook 2002 for Dummies
- F1 Get the Most out of Excel! The Ultimate Excel tip Help Guide
- The New Financial Order: Risk in the Twenty-First Century
No comments have been submitted.

