Copy Cell Color to Another Cell Using If Statement

Foxmann250

New Member
Joined
Jun 28, 2013
Messages
37
Hey Guys,

I'm not too savvy when it comes to VBA so I need a bit of assistance. I'm trying to make cell C1's color match cell C3's color when I input "1" into cell L1. Then I'd like to alter this code so that if I input "2" into cell L1, C1's color will match cell C4's color, and so on. I'd like this macro to run anytime cell L1 changes.

Thanks for the help in advance.

Josh
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I'd suggest using conditional formatting over VBA for this.
Home-->Conditional Formatting-->New rule


I'd say the 'use a formula to determine which cells to format option' is What you'd need.
 
Upvote 0
Hey thanks for the reply. Let me try to explain better what I'm trying to do and why conditional formatting doesn't work for me.

Cell C3 has color scale conditional formatting, so that cell will change shades of colors depending on its value. It's value will change daily as will its color. I then want cell C1 to change its color to match what C3's color is since cell C1 will have a constant value and never change. That way cell C1's color changes but the value is always the same. From my understanding there is no conditional formatting rule that can do this.

THEN... I have a graph. This graph is linked to C1 (as well as some other cells) and I would like the colors of my graph to match the color of cell C1. That way, as C3 changes, C1 will also change, as will the graphs color. It's kinda hard to explain so if you need me to post some pics or the doc itself I can. This is all an attempt to use a donut and pie chart to create a heat map of a circle.
 
Upvote 0
Here's what I'm working on:

The values in C2:H2 are constants that the Donut graph is referencing. I2 is what the pie graph is referencing. These cells can't change value or the graphs would not be sectioned the way I need them to be. If I can have each section of the donut/pie graphs change color to the cells they are referencing (C2:I2) then all I would need is to have those cells change color to what I want. My end goal is to be able to input the # I want in L2 and have C2:I2 change color to C4:I4, C5:I5, etc. Hope that helps.

 
Upvote 0

Forum statistics

Threads
1,226,478
Messages
6,191,237
Members
453,649
Latest member
jtc19

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