Conditional format if cell = constant

prakitpom

New Member
Joined
Aug 18, 2011
Messages
4
My column B contains formula. But if someone changes it to a constant value, I would like to have it automatically highlighted in red. Can I use a conditional format function to do this? thanks...
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi everybody, I like this method but I cant make it work in my excel. I use an Spanish 2013 version. Can you help me. Thank in advance for your work in this forum.
 
Upvote 0
Hi,

Welcome to the forum!

Maybe this

Right-click in sheet-tab; pick View Code; paste the code below in the right-panel

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B:B")) Is Nothing Then
        If Target.HasFormula Then
            Target.Interior.Color = xlNone
        Else
            Target.Interior.Color = vbRed
        End If
    End If
End Sub

HTH

M.


Hi everybody, I like this method but I cant make it work in my excel. I use an Spanish 2013 version. Can you help me. Thank in advance for your work in this forum.
 
Upvote 0
Hello again. Finally I could make it work.

I only write this lines

Code:
        If Target.HasFormula Then
            Target.Font.Color = RGB(165, 0, 63)
        End If

Now every cell in that particular sheet where I make a formula appear with font in color. That is very useful for me.

But, it would be better if all my new workbook that I create look like this (formulas in color) without do anything anymore. Could be this possible??? Thanks
 
Upvote 0
But, it would be better if all my new workbook that I create look like this (formulas in color) without do anything anymore. Could be this possible??? Thanks


I do not know how to do this without a code, or even if it is possible.


M.
 
Last edited:
Upvote 0
Thanks for your answer Marcelo.

I understand that it is needed a code but, is there any method to "tell" excel to used this code in all the sheets when I create a new workbook???
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

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