PDA

View Full Version : Solved: Conditional formatting



Buyone
07-21-2007, 03:26 PM
Happy saturday night! I've just spent all of my free day trying to organize a summary spreadsheet, and I'm nearly there through a magical mix of formulas and pasted links. I did attempt the macro route but everything I found didn't quite give what I was looking for, plus I have no idea on how to amend them to do my bidding.
Now, the last thing i need doing is higlighting cells that have duplicates either above or below them. I've tried a few conditional formatting formulas, but they just highlight every dupe? Any ideas people?


The attached is the kind of thing I'm after.
If you find this a little easy, I've got a plenty more challenging tasks up my sleeve!

Cheers

Bob Phillips
07-21-2007, 04:13 PM
Why doesn't C10 get highlighted, it has a duplicate above? and doesn't a duplicate either above or below mean any duplicate?

Bob Phillips
07-21-2007, 04:15 PM
Perhaps you mean immediately above or below

Formula of

=OR(C5=C4,C5=C6)

Buyone
07-21-2007, 04:18 PM
Xld,

The only cells I want to highlight need to be adjoining. Thats why only the two 'bobs' that are touching have a different format.
The sheet this comes from would have a number of duplicates, but I'm only interested in ones that are close together as it is time sensitive.
Does that make sense?

Cheers

Charlize
07-21-2007, 04:21 PM
Not sure if this is what you want (did this with my eyes closed ...).Sub mark_doubles()
Dim cell As Variant
For Each cell In Range("C5:C" & Range("C" & Rows.Count).End(xlUp).Row)
If cell.Offset(1, 0).Value = cell.Value Then
cell.Interior.ColorIndex = 3
cell.Offset(1, 0).Interior.ColorIndex = 3
End If
Next cell
End Sub

Buyone
07-21-2007, 04:31 PM
Hi Charlize,

Thanks for that, it all seems so easy now. I'll play around with it to get the text bold aswell. But you've made a tired man happy!
I'll try to challenge your skills more next time.

Cheers

Charlize
07-21-2007, 04:35 PM
I think you'll learn a lot more from xld than from me. I'm just starting to see all the possibilities where I could take advantage of the things I have learned from here. To answer the question regarding the bold thing : cell.Font.Bold = True