Put a value in a cell if any cell in a row of cells has a colored font

Stovey31

New Member
Joined
Oct 17, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
HI, I want to be able to return a value to a cell if any of the cells in the same row have red font. For example as columns B and D have red font I would like to have D2 and D4 return the text "Update" and any other cells in D where there is no red font either stay blank or return text "No changes"
ABCD
1ETAContainerComments
225/4abcd123456As booked
316/2ghfd58562
4TBCOffloaded
51/3defg5894

Thanks for any help you can provide.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I see no red font in column D
You said:
as columns B and D have red font

I see red font in column B and C
 
Upvote 0
Hi there;

Create the UDF:

VBA Code:
Public Function CountCellsWithRedFontColor(Range1 As Range) As Integer
Application.Volatile
Dim myRng As Range
For Each myRng In Range1
    If myRng.Font.Color = vbRed Then
        CountCellsWithRedFontColor = CountCellsWithRedFontColor + 1: Exit Function
    End If
Next
End Function

Then in D2:
Excel Formula:
=IF(CountCellsWithRedFontColor(A2:C2),"Update","No changes")
and copy down.
 
Last edited:
Upvote 0
Try this:
VBA Code:
Sub Check_For_Red_Font()
'Modified  10/17/2022  11:06:55 PM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row

    For i = 2 To Lastrow
        If Cells(i, 2).Font.Color = vbRed Or Cells(i, 3).Font.Color = vbRed Then
            Cells(i, 4).Value = "Update"
        Else
            Cells(i, 4).Value = "No Changes"
        End If
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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