For Each rcell In rg
If rcell.Value <> rcell.Offset(-1, 0).Value Then
If rcell.Offset(-1, 0).Interior.ColorIndex = 19 Then
Rows(rcell.row).Interior.ColorIndex = 2
Else
Rows(rcell.row).Interior.ColorIndex = 19
End If
Else
Rows(rcell.row).Interior.ColorIndex = rcell.Offset(-1, 0).Interior.ColorIndex
End If
Next rcell
I need the logic how to handle color setting for an array e.g.
777,777,777,888,888,999,999,999,999
The logic above is in excel vba, if someone can help, I appreciate. I had tried below, but it did not work the way I want it.
for(i=0;i<arraysize;i++)>
{
if (array[i] == array[i-1])
setColor(YELLOW);
else
setColor(White);
}
I like to do the color like odd and even,
if 777,77,777 then set yellow
if 888,888 then set white
if 999,999,999 then set yellow
etc...
Thanks in advance.
[edit]Code block added - OriginalGriff[/edit]