Solved Conditional Format with Macro

April 29, 2013 at 13:24:57
Specs: Windows 7
In Excel 2010, how can I format column H of each worksheet - number of rows may vary, where the cell is highlighted for each value that is greater than 25.00?

See More: Conditional Format with Macro

April 29, 2013 at 15:52:28
How many sheets do you have?

If you have a few, then you can do a Copy / Paste Special / Formats.

Select Sheet 1, Column H,
Conditional Format the whole column

Select Copy
Select Sheet 2, Column H
Paste Special, Format

Repeat for the next few sheets.


Report •

April 29, 2013 at 18:00:09
✔ Best Answer
This will CF Column H of all sheets with a fill color of Yellow:

Sub CF_Column_H()
 For shtNum = 1 To Sheets.Count
    With Sheets(shtNum).Columns("H:H")
      .FormatConditions.Add Type:=xlExpression, Formula1:="=H1>25"
        .FormatConditions(1).Interior.PatternColorIndex = xlAutomatic
        .FormatConditions(1).Interior.Color = 65535
        .FormatConditions(1).Interior.TintAndShade = 0
        .FormatConditions(1).StopIfTrue = False
    End With
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

April 30, 2013 at 05:41:01
Thank you! Both options work but I do need to run it as a macro so DerbyDad's answer works perfectly for me!

Report •
Related Solutions

Ask Question