我有一个excel sheet...where,我想根据以下条件对单元格进行着色:
注意:要在模块section...so中实现这一点,建议相应的解决方案!!
发布于 2012-11-26 17:44:20
像这样的东西有用吗?
Dim Row
Row = 3
If Not IsEmpty(Cells(Row, 5)) Then
' if Cell E is not empty, then highlight empty cols A-I
For chkcol = 1 To 9
If chkcol <> 5 Then ' ignore column E
If IsEmpty(Cells(Row, chkcol)) Then
Cells(Row, chkcol).Interior.ColorIndex = 3
End If
End If
Next
Else
blnvalid = True
' check for cell E being empty and all others not
For chkcol = 1 To 9
If chkcol <> 5 Then
If IsEmpty(Cells(Row, chkcol)) Then
blnvalid = False
Exit For
End If
End If
Next
If blnvalid Then
Cells(Row, 5).Interior.ColorIndex = 3
End If
End Ifhttps://stackoverflow.com/questions/13569320
复制相似问题