简体   繁体   中英

Set value of a cell based on the text color of another cell on the same row

I have received an Excel file where some rows on a sheet have a red text color. These are the rows that should be flagged as "to be removed". So I have added a new column on the table called "Status".

On this column, if the text color of another column (say "email") on the same row is red, I would like to have a value of 1 and otherwise 0.

How should I create the formula or rule for these cells?

I will normally create a function to get the colour index.

` Function text_colour(x As Range)

text_colour = x.Font.ColorIndex

End Function `

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM