if cell is red then display a value from another cell on the same column.

StF

New Member
Joined
Nov 20, 2020
Messages
1
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello,

I have a time report where the weekends and legal holidays are autofilled in red if an employee is registered as working.
Due to new legislation I need to keep a record of those days.
I would like to auto check if every row(eg. F17:AJ17) has red cells and then paste a date from a cell that is on row 4, same column as the red one.
The final result should look like cell P7.
I already lost several hours and on this and simply can't get it even near right. Thanks a lot.
 

Attachments

  • template 1.JPG
    template 1.JPG
    115.7 KB · Views: 11

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You could use a UDF such as this (assuming this is the correct shade of red):

VBA Code:
Function ContainsRedCells(Reference As Range) As Boolean

Dim cell As Range

    For Each cell In Reference.Cells
        If cell.Interior.Color = 255 Then
            ContainsRedCells = True
            Exit Function
        End If
    Next cell

End Function
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,246
Members
449,075
Latest member
staticfluids

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