Hi All,
I’ve seen a couple of threads that have started me in the right direction but I can’t figure out how to apply them to my situation. This will be a big info dump and if anyone sees an alternative solution that is obvious and I've missed then I'm all ears. I'm trying to conditionally format rows of data based on duplicates in the first column, then filter the results. I have a table of data with mutiple variables assigned to different "headings" that looks a little something like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0001
[/TD]
[TD]Alpha
[/TD]
[TD]Nil
[/TD]
[TD]Nil
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]XXX
[/TD]
[TD]12
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD][/TD]
[TD][/TD]
[TD]ZZZ
[/TD]
[TD]02
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]XXX
[/TD]
[TD]09
[/TD]
[TD]BBB
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The data then gets filtered using Excel’s normal built-in Filter function by putting the drop-downs across the header row.
You might be able to see where this is going…
If I filter column C for Variable 1 = YYY I’m going to get
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
When I need to see this instead:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD]BBB
[/TD]
[/TR]
</tbody>[/TABLE]
Merged cells are the work of the devil and it’s a requirement of the client to
I’ve written a macro that fills in the blanks on the table to look like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0001
[/TD]
[TD]Alpha
[/TD]
[TD]Nil
[/TD]
[TD]Nil
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]XXX
[/TD]
[TD]12
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]ZZZ
[/TD]
[TD]02
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]XXX
[/TD]
[TD]09
[/TD]
[TD]BBB
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD]BBB
[/TD]
[/TR]
</tbody>[/TABLE]
Format the text to white in columns A, B, and E based on there being a duplicate above that row in Column A only. i.e. conditionally format the values with a * below:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0001
[/TD]
[TD]Alpha
[/TD]
[TD]Nil
[/TD]
[TD]Nil
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]XXX
[/TD]
[TD]12
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0002*
[/TD]
[TD]Beta*
[/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD]AAA*
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0002*
[/TD]
[TD]Beta*
[/TD]
[TD]ZZZ
[/TD]
[TD]02
[/TD]
[TD]AAA*
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]XXX
[/TD]
[TD]09
[/TD]
[TD]BBB
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0003*
[/TD]
[TD]Gamma*
[/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD]BBB*
[/TD]
[/TR]
</tbody>[/TABLE]
If I use the conditional formula I found: =A1=A2, then cell E3 gets made white text when I don’t want it to, hence the “referencing column A” part of the question (Column A is always a unique ID number whereas Column E can have a duplicate in the row above). [Edit: Why can't I type Enter or put a line break here... I'll try re-edit at home...] When I go to filter on Column C for YYY again, the conditional formatting needs to realise to un-white the text, which is my next headache because it means conditional formatting that acts relative to hidden rows as a result of a filter... Oh and did I mention the client wants this done in 2003? This is an afterthought though – as I can force them to use 2010 if need be
I’ve seen a couple of threads that have started me in the right direction but I can’t figure out how to apply them to my situation. This will be a big info dump and if anyone sees an alternative solution that is obvious and I've missed then I'm all ears. I'm trying to conditionally format rows of data based on duplicates in the first column, then filter the results. I have a table of data with mutiple variables assigned to different "headings" that looks a little something like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0001
[/TD]
[TD]Alpha
[/TD]
[TD]Nil
[/TD]
[TD]Nil
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]XXX
[/TD]
[TD]12
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD][/TD]
[TD][/TD]
[TD]ZZZ
[/TD]
[TD]02
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]XXX
[/TD]
[TD]09
[/TD]
[TD]BBB
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The data then gets filtered using Excel’s normal built-in Filter function by putting the drop-downs across the header row.
You might be able to see where this is going…
If I filter column C for Variable 1 = YYY I’m going to get
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD][/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
When I need to see this instead:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD]BBB
[/TD]
[/TR]
</tbody>[/TABLE]
Merged cells are the work of the devil and it’s a requirement of the client to
- Have the data formatted like the first table
- Use the normal Excel filter function
I’ve written a macro that fills in the blanks on the table to look like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0001
[/TD]
[TD]Alpha
[/TD]
[TD]Nil
[/TD]
[TD]Nil
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]XXX
[/TD]
[TD]12
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]ZZZ
[/TD]
[TD]02
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]XXX
[/TD]
[TD]09
[/TD]
[TD]BBB
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD]BBB
[/TD]
[/TR]
</tbody>[/TABLE]
I’m stuck on how to input a formula into the conditional formatting window that will:[selects the table, then GoTo Special selects the blanks, fills in the blanks with the cell above, then Copy and Pastes As Values the entire table again to fill everything in]
Format the text to white in columns A, B, and E based on there being a duplicate above that row in Column A only. i.e. conditionally format the values with a * below:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Ref #
[/TD]
[TD]Heading
[/TD]
[TD]Variable 1
[/TD]
[TD]Variable 2
[/TD]
[TD]Department
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0001
[/TD]
[TD]Alpha
[/TD]
[TD]Nil
[/TD]
[TD]Nil
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0002
[/TD]
[TD]Beta
[/TD]
[TD]XXX
[/TD]
[TD]12
[/TD]
[TD]AAA
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0002*
[/TD]
[TD]Beta*
[/TD]
[TD]YYY
[/TD]
[TD]13
[/TD]
[TD]AAA*
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0002*
[/TD]
[TD]Beta*
[/TD]
[TD]ZZZ
[/TD]
[TD]02
[/TD]
[TD]AAA*
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0003
[/TD]
[TD]Gamma
[/TD]
[TD]XXX
[/TD]
[TD]09
[/TD]
[TD]BBB
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0003*
[/TD]
[TD]Gamma*
[/TD]
[TD]YYY
[/TD]
[TD]21
[/TD]
[TD]BBB*
[/TD]
[/TR]
</tbody>[/TABLE]
If I use the conditional formula I found: =A1=A2, then cell E3 gets made white text when I don’t want it to, hence the “referencing column A” part of the question (Column A is always a unique ID number whereas Column E can have a duplicate in the row above). [Edit: Why can't I type Enter or put a line break here... I'll try re-edit at home...] When I go to filter on Column C for YYY again, the conditional formatting needs to realise to un-white the text, which is my next headache because it means conditional formatting that acts relative to hidden rows as a result of a filter... Oh and did I mention the client wants this done in 2003? This is an afterthought though – as I can force them to use 2010 if need be
Last edited: