Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Formatting
I am looking for a formula that I could add to conditional formatting to
highlight groups of rows EVERY OTHER time the value changes in a column, say column C. In my example below if the following values are found in column C, then the rows containing the 460 values, the 493 values and the 619 values would all be highlighted, and the rows containing the 481 values and the 610 values would be unhighlighted. If conditional formatting is not the way to go and I need to use code to accomplish this then I would like the help writing the code. Thanks for your help. Col C 460 460 460 481 481 481 481 493 493 610 610 619 619 619 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Formatting
You have to do it with code
Sub switch_colors() Const ColorRed = 3 Const ColorBlue = 5 RowCount = 1 Color1 = ColorRed Color2 = ColorBlue MyColor = Color1 Do While Range("C" & RowCount) < "" Range("C" & RowCount).Interior.ColorIndex = MyColor If Range("C" & RowCount) < Range("C" & (RowCount + 1)) Then If MyColor = Color1 Then MyColor = Color2 Else MyColor = Color1 End If End If RowCount = RowCount + 1 Loop End Sub "DBavirsha" wrote: I am looking for a formula that I could add to conditional formatting to highlight groups of rows EVERY OTHER time the value changes in a column, say column C. In my example below if the following values are found in column C, then the rows containing the 460 values, the 493 values and the 619 values would all be highlighted, and the rows containing the 481 values and the 610 values would be unhighlighted. If conditional formatting is not the way to go and I need to use code to accomplish this then I would like the help writing the code. Thanks for your help. Col C 460 460 460 481 481 481 481 493 493 610 610 619 619 619 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I convert conditional formatting into explicit formatting? | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |