Please help with Colour and Cell Value :0)

will2soar

New Member
Joined
Dec 2, 2017
Messages
3
Hello,

The enter key got away from me in the last post.

I need help with this problem

[TABLE="width: 300"]
<tbody>[TR]
[TD][/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]6[/TD]
[TD]8[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3[/TD]
[TD]6[/TD]
[TD]9[/TD]
[TD]12[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]8[/TD]
[TD]12[/TD]
[TD]16[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5[/TD]
[TD]10[/TD]
[TD]15[/TD]
[TD]20[/TD]
[TD]25[/TD]
[/TR]
</tbody>[/TABLE]

MY table is something like this and the background or cell fill matches the colour of the numbers. there are five different colours.


[TABLE="width: 500"]
<tbody>[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]


What I'd like the sheet to do is, match the third column value and background fill to the same background fill colour and value as in the table.

Can anyone please help me sort this one out.

TY

B
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If the colors in the key don't change, you can setup individual conditional formatting for value ranges. If it's going to be variable, I think the only solution would be through VBA. As an example:
Code:
Sub MultColor()
    Dim x As Range
    
    Set x = Sheets("ColorKey").Range("B2:F6").Find(What:=Range("C21").Value, After:=Cells(2, 2), _
        LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=True)
    
    Range("C21").Interior.Color = x.Interior.Color
    Range("C21").Font.Color = x.Font.Color
End Sub
 
Upvote 0

Forum statistics

Threads
1,226,694
Messages
6,192,473
Members
453,726
Latest member
JoeH57

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