Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
after having recorded a macro containing 3 conditional formats, i retrieve
the following code in VBA Editor : Range("C24:AF54,C60:AF90,C96:AF126").Select Selection.FormatConditions.Delete Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="1" Selection.FormatConditions(1).Font.ColorIndex = 11 Selection.FormatConditions(1).Interior.ColorIndex = 11 Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="0,5" Selection.FormatConditions(2).Font.ColorIndex = 41 Selection.FormatConditions(2).Interior.ColorIndex = 41 Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="-0,5" Selection.FormatConditions(3).Font.ColorIndex = 15 Selection.FormatConditions(3).Interior.ColorIndex = 15 Sheets("Test2").Select after the "Selection.FormatConditions(3).Interior.ColorI ndex = 15" line, i try adding a fourth conditional format in VBA as follows: Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="-1" Selection.FormatConditions(4).Font.ColorIndex = 20 Selection.FormatConditions(4).Interior.ColorIndex = 20 However, when i run the macro, an error is returned at the " Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="-1" " line is it possible to add a fourth (fifth,..) conditional format ? thanks andy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formats, how to scroll and view all formats? | Excel Worksheet Functions | |||
Conditional formats- paste special formats? | Excel Discussion (Misc queries) | |||
paste conditional formats as formats | Excel Discussion (Misc queries) | |||
How do I add more Conditional Formats? | Excel Discussion (Misc queries) | |||
Any way to have more than three conditional formats? | Excel Worksheet Functions |