Macro to Simulate CF Italic Red Font based on Formula Criteria

S

Sam

Hi All,

I would like to use the cell Font colour to analyse data by summing and
counting the cells by Font colour. However, I realised that I was not able to
count or sum cells by colour using Excel Conditional Formula Is option.

After reading through some very informative and helpful websites:
http://www.mvps.org/dmcritchie/excel/colors.htm,
http://www.cpearson.com/excel/CFColors.htm,
http://www.ozgrid.com/VBA/Sum.htm and
http://www.xldynamic.com/source/xld.CFConditions.html; I found Functions that
can do the Counting and Summing.

I'm having difficulty in turning the Conditional Formula below into a Macro
to colour the matched criteria cell with Red & Italic Font. Can anyone
convert my original CF below to a VBA Macro to colour criteria matching cells
with Red Italic Font?

Range("CD5:EZ5").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=AND(CD$9>TRANSPOSE(Label_MEDIAN),CD$10>TRANSPOSE(Label_MEDIAN))*CD
$6>TRANSPOSE(Label_MEDIAN)"
With Selection.FormatConditions(1).Font
.ColorIndex = 3
.Bold = False
.Italic = True
End With

Thanks
Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top