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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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