Possibility of having an If condition result linked to a cell color VBA

AoS80

New Member
Joined
Jan 31, 2023
Messages
6
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Mobile
Hello,

I was wondering if there is it possible to Link an IF condition with a cell color instead of a specific data using VBA.

For example:

A range of cells B4:B20 have data lets say numbers. some of those cells will change color to blue. for the sake of the example lets say B7 changed color to blue. I am trying to make cell C7 to have an IF condition ===> IF B7 turns blue then type "this change to blue due to error in system"

Thank you for your support in advance.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,

An If formula cannot catch a color change ...
Before describing the solution you are thinking of ...
What is exactly the situation and the obstacle you are facing ???
 
Upvote 0
Hi,

An If formula cannot catch a color change ...
Before describing the solution you are thinking of ...
What is exactly the situation and the obstacle you are facing ???
Hi James,

Thank you for your reply.

I am trying to help a friend in every possible way that i could think of. He is trying to have multiple color coding using conditional formatting in a certain range when certain numbers appears within the data in a cell and wants to see the results in the next cell.

B7 cell contains [ A01-250-669-T15]. If any of the data contains T11-T15 the B7 should be colored blue and C7 should have an explanation of that error.

What i had in mind is i could use a formula in C7 =If(Left(B7,3)="T15",TRUE,False). However, if it is other than T15" i have then to change the False function into another If formula and this will cause Endless IFs.

Not sure where to go from there.
 
Upvote 0
Hi again,

You can have a look at the VBA solution designed by Jaafar :
 
Upvote 0
Hi again,

If you are using conditional formatting ... things do get a lot easier ...!!!

Indeed, you can completely forget the colors ... and relying on the real logic ... i.e. the rules and conditions found in the underlying formulas ...
 
Upvote 0
Hi again,

Even simpler, for your cell B7, with no possible error, you can use Conditional Formatting formula:

Excel Formula:
=AND(MID(B7,13,2)="T1",AND(VALUE(RIGHT(B7,1))>=1,VALUE(RIGHT(B7,1))<=5))

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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