Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Conditional Formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DBavirsha - 31 Mar 2008 15:44 GMT
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
Joel - 31 Mar 2008 16:00 GMT
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

> 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
[quoted text clipped - 22 lines]
> 619
> 619
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.