IF: color of cell > color next row

G

Guest

I've got an Excel sheet that I'm trying to make more readable by sorting/grouping numbers in column 2, and
making one grouping of rows/column 2 numbers with no fill color (Interior.ColorIndex = x1none). When
the number in Column 2 changes, I want to go from "no color" to Interior.ColorIndex = 35

What I need to know is how to look at the color of a cell in row 1 and determine if the corresponding cell in
row 2 is different. And if it is different, then row 2 gets Interior.ColorIndex = 35. Below is what I've tried s
far that doesn't work. Many thanks, John

If Cells(rowctr, 2) <> Cells(rowctr + 1, 2) The
Range("A" & rowctr).Selec
If ActiveCell.Interior.ColorIndex = x1none The
Range("A" & rowctr + 1, "L" & rowctr + 1).Selec
With Selection.Interio
.ColorIndex = 3
End Wit
End I

If Selection.Interior.ColorIndex = 35 The
Range("A" & rowctr + 1).Selec
With Selection.Interio
.ColorIndex = x1non
End Wit
End I
End If
 
M

mudraker

If Cells(rowctr, 2).Interior.ColorIndex <> Cells(rowctr + 1
2).Interior.ColorIndex Then
Cells(rowctr + 1, 2).Interior.ColorIndex = 35
End I
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top