如果同一行中的两个特定单元匹配,则会对同一行中的另一个单元执行某些操作

基本上,我正在试图按照标题所述。

如果两个单元格在同一行完成

之前

然后,删除线并突出显示同一行中的另一个单元格 后

使用此条件格式公式将列条件格式应用于列A:

=C1&D1="donedone" 

然后用删除线格式化并填充颜色为黄色

你想使用条件格式,公式还是VBA?

条件格式

在这里输入图像说明

VBA:

 Sub colorCells() For x = 1 To Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row If Cells(x, 3) = "done" And Cells(x, 4) = "done" Then Cells(x, 1).Interior.Color = RGB(255, 255, 0) Cells(x, 1).Font.Strikethrough = True Else Cells(x, 1).Interior.Color = xlNone Cells(x, 1).Font.Strikethrough = False End If Next x End Sub