Hi all,
I am currently working on a set of data which required me to highlight data that 3x times greater than average by using vba. I try to code it myself but seem cannot find the solution.
Here my coding
Sub FormattingCell()
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each ws In Application.ActiveWorkbook.Worksheets
If ws.Name <> "data" Then
With Range("D2:D1000000").FormatConditions.Add( _
Type:=xlExpression, _
Formula1:="D:D > Average(D:D)*3")
.Interior.Color = RGB(198, 239, 206)
.Font.Color = RGB(0, 97, 0)
End With
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Bookmarks