我没有条件格式化的经验,我需要一些帮助。我必须写一个公式,说明如果:
感谢您的帮助和时间!
我的代码:
Sub testcells (z As Long)
If Cells(z, "A") = "Test" And Cells(z, "B") = "Support" Then
Cells(z, "c").Interior.Color = RGB(255, 0, 0)
ElseIf Cells(z, "A") = "Test 1" And Cells(z, "B") = "Support" Then
Cells(z, "c").Interior.Color = RGB(255, 0, 0)
ElseIf Cells(z, "A") = "Test 2" And Cells(z, "B") = "Support" Then
Cells(z, "c").Interior.Color = RGB(255, 0, 0)
Else
Cells(z, "c").Interior.Color = RGB(255, 255, 255)
End If
End Sub
答案 0 :(得分:1)
在我的擅长中,这有效:
=IF(AND(A2="test";B2="Support";ISBLANK(C2)=TRUE);TRUE;FALSE)
你根本不需要VBA。