Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Frank,
I use the code below very succesfully. Sub ColorWhenValueChange() ' 'The xlsweetspot guy would would do it this way. Dim strActiveAddress As String 'Use this to track single cell position Application.ScreenUpdating = False ActiveCell.Offset(2, 0).Select Do While Len(ActiveCell.Value) < 0 ' This will run until a row isblank. strActiveAddress = ActiveCell.Address ' Compare the values in the current cell with the one above If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then ActiveCell.EntireRow.Offset(-1, 0).Copy ActiveCell.EntireRow.PasteSpecial xlPasteFormats Else If ActiveCell.Offset(-1, 0).Interior.ColorIndex = xlNone Then ActiveCell.EntireRow.Interior.Color = RGB(255, 255, 153) '36 < - Change colour value here Else ActiveCell.EntireRow.Interior.ColorIndex = xlNone End If End If Range(strActiveAddress).Select ActiveCell.Offset(1, 0).Select Loop End sub Best regards, Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting Alternating Rows with a Color | Excel Worksheet Functions | |||
Alternating Color Rows | Excel Discussion (Misc queries) | |||
Using cell color in conditional format makes Excel unstable | Excel Programming | |||
How do I set an auto alternating row color? | Excel Discussion (Misc queries) | |||
macro or vb to alternating row color | Excel Programming |