Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I convert conditional formatting into explicit formatting? Patrick Harris Excel Discussion (Misc queries) 0 April 9th 09 12:00 AM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"