CF Based upon other cell color

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,113
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Under conditional formatting, how would I provide; if Cell D12 has an interior color yellow that cell A12 will provide an interior color yellow?

For example after the CF is applied:

Unddddtdditled.png


Please let me know when you can.

Thank you!

Respectfully,
pinaceous
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Pinaceous

For me, it's impossible with conditional formatting, because with an Excel formula, you cannot know the interior color of the cell

But, with a custom function in VBA it may be possible ;)
Disadvantage, it requires a recalculation of the sheet, i.e. a modification of a cell (F2 + enter may be sufficient)

The VBA function
VBA Code:
Function InteriorColorIsYellow(Cel As Range)
  Application.Volatile
  InteriorColorIsYellow = (Cel.Interior.Color = 65535)
End Function

The formula of MFC
Excel Formula:
=Interiorcolorisyellow($D6)

here is the file, I did not know how to do otherwise than by depositing it on a platform :confused:
 
Upvote 0
Hi BrianM45,

So where would I put the Function code? Upon the Microsoft Excel Objects (Sheet) codes, ThisWorkbook or in a Module?

BTW, I have more than one sheet that I'd like to apply this Function to.

Please let me know and I appreciate the code!

-pinaceous

PS> let me download your file
 
Upvote 0
You have to put the custom function in a module ;)

To download the file, you just have to click on it, on the platform given in the link :unsure:
 
Upvote 0
@BrianM45 ,are you saying that the function should be put in the conditional formatting rule? That is pretty cool.
 
Upvote 0
@awwohaww, yes a custom function can be placed in MFC like any other Excel function ;)

@Peter-SSs, th yellow in column D done manually
 
Upvote 0
:ROFLMAO: No

My little function and how-to only works for manually applied color
 
Upvote 0
Is the yellow in column D done manually or by code or by conditional formatting?
Hi Peter_SSs!

The yellow in column D is done by conditional formatting. My question now is how I make column A internal color yellow in corresponding to it?

VBA Code:
Option Explicit

Function InteriorColorIsYellow(Cel As Range)
  Application.Volatile
  InteriorColorIsYellow = (Cel.Interior.Color = 65535)
End Function

I could use the function but I need to add something but do not know what.

Can you help?

Thank you!
pinaceous
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,469
Latest member
Kingwi11y

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