Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rows ColorIndex
Hi Group,
Needs some help on following; Have a column with variable values as: 1 1 1 2 2 3 4 4 4 5 5 etc The number of rows with 1:s etc are changing. Try to give the rows with the same value the same InteriorColor in 2 shades. First all 1:s to be ColorIndex =15 then the 2:s Colorindex = 0 then again the 3:s ColorIndex = 15 etc. What is the best approch to this ? Happy New Year CG Rosén |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Rows ColorIndex
Sub Tester1()
Dim icolor As Long Dim i As Long Dim rng As Range icolor = 0 Set rng = Cells(1, 1) i = 1 Do While Not IsEmpty(Cells(i, 1)) If Cells(i + 1, 1) < Cells(i, 1) Then If icolor = 0 Then icolor = 15 Else icolor = 0 Range(rng, Cells(i, 1)).Interior.ColorIndex = icolor Set rng = Cells(i + 1, 1) End If i = i + 1 Loop End Sub -- Regards, Tom Ogilvy "CG Rosén" wrote in message ... Hi Group, Needs some help on following; Have a column with variable values as: 1 1 1 2 2 3 4 4 4 5 5 etc The number of rows with 1:s etc are changing. Try to give the rows with the same value the same InteriorColor in 2 shades. First all 1:s to be ColorIndex =15 then the 2:s Colorindex = 0 then again the 3:s ColorIndex = 15 etc. What is the best approch to this ? Happy New Year CG Rosén |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Exel 97 ColorIndex | Excel Discussion (Misc queries) | |||
ColorIndex | Excel Worksheet Functions | |||
VBA ColorIndex Formatting | Excel Discussion (Misc queries) | |||
colorindex | Excel Discussion (Misc queries) | |||
Font and Fill ColorIndex | Excel Programming |