Conditional Formatting - color groups based on row value

djangeroo

New Member
Joined
Nov 23, 2005
Messages
4
Hi,
I am new to the forum and impressed by the great advise that's out there.

This is my problem:
A list with numbers in column A, these numbers can be used over multiple rows, sometimes 3, 5 or more/less.
Every time this number changes, the color for the entire row should flip between yellow and no color.
Sequence of the number in column A is not always odd / even. I tried various suggestions regarding this topic but I do not get it straight.

Thanks for your help.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
lenze,
following your link, I had to click another link, then again and again

can't find the tree in the wood
which post are you refering to ?

best regards,
Erik
 
Upvote 0
Now Erik ... here is one without the helper column ... (in the right thread this time) ...
Book2
ABCD
1
2
31
4
52
6
72
8
93
10
112
12
132
14
Sheet8


formula in cell A1 is ...

=$A1=cell("contents")

and to help trigger the highliting (as in my other post: http://www.mrexcel.com/board2/viewtopic.php?t=181451&start=20), I used the following code ...
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Yogi,
but this was not the goal
or do I (again ;) ) miss something ?

A
A
A

B
B

C
C

D
D
D

and sorting won't disturb the colors ...

best regards,
Erik
 
Upvote 0
Hi Erik:

You may be right. In my proposed solution, let us say the cells containing 2 will be highlited yellow, even if the entries in the cells are changed, the highliting will follow the changed entry ... but my cursor has to remain in the cell with the entry to be highlited.

Perhaps I am the one who missed something ... you guys were well into it when I joined in later ... and I may not have understood all of the OP's requirements.
 
Upvote 0
yeah, in THIS thread ;) it was a question of "alternating format"
each time the value changes the color changes (using one color and "default-white")

enjoyed our meetings this night !!
going to sleep right now
 
Upvote 0
I can modify my Conditional Formatting formula to ...

=and($A1=cell("contents"),$A1<>"')

to ensure that when the cursor is moved to a blank cell, no rows are highlited.

However, I don't know whether even with this modification, I am meeting all of the specifications of the OP.
 
Upvote 0
thanks, lenze,

it was clear where to go now
the formulasystem needs two columns and does not handle correctly non-sorted lists like this one, where the same items are not adjacent
 Smith
 Smith
 Taylor
 Taylor
 Ulmer
 Ulmer
 Ulmer
 Smith
 Smith
unless I'm missing something?

the formulas we displayed earlier, thanks to NBVC, based on what you can find here
http://www.mvps.org/dmcritchie/excel/condfmt.htm
seem to work always to my sense sorted or not

best regards,
Erik
 
Upvote 0
What about this one? The only thing with this one is that you apply the Conditional Formatting formula to the whole data range EXCEPT the first row. So in the example below, select A3:D11 and apply the Conditional Formatting.. Formula is:
=MOD(SUMPRODUCT(--($A$2:$A2<>$A$3:$A3)),2)

If data is positioned elsewhere, replace the $A$2 with the top left cell in the DATA range (that is, the cell ABOVE the top left of the SELECTED range) and replace the $A$3 with the top left cell of the SELECTED range (that is the left cell in the SECOND row of the DATA range) and change the $A2 and $A3 accordingly.
Mr Excel.xls
ABCDE
1HeadingHeadingHeadingHeading
2John123
3John123
4Jack123
5Jack123
6Marg123
7Bart123
8Maggie123
9Maggie123
10Del123
11Del123
12
Sheet1 (3)


Edit: I've joined this thread late and may have missed something... possibly in one of the linked threads? or just going blind? I note that one of Erik's responses mentions sorting, but I couldn't see where this was referred to. My suggestion will not cope too well with subsequent sorting.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,657
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top