如果 excel 中的任何单元格为空,则突出显示整行
Highlight entire row if any cell is empty in excel
我有来自 A:AD 的数据。即使 A:AD 中的任何单元格为空,我也需要将整行突出显示为灰色。
试试这个,
Private Sub Worksheet_Change(ByVal Target As Range) //Change this range
Set MyPlage = Range("YourRange") //Change this range
For Each Cell In MyPlage
Select Case Cell.Value
Case Is = "Withdrawn"
Cell.EntireRow.Interior.ColorIndex = 7
Case Is = "Postponed"
Cell.EntireRow.Interior.ColorIndex = 8
Case Is = "Terms Agreed"
Cell.EntireRow.Interior.ColorIndex = 4
Case Is = "Papers Rec"
Cell.EntireRow.Interior.ColorIndex = 3
Case Else
Cell.EntireRow.Interior.ColorIndex = xlNone
End Select
Next
End Sub
http://ccm.net/faq/8847-excel-vba-a-macro-to-change-the-color-of-a-row
http://dmcritchie.mvps.org/excel/colors.htm
我有来自 A:AD 的数据。即使 A:AD 中的任何单元格为空,我也需要将整行突出显示为灰色。
试试这个,
Private Sub Worksheet_Change(ByVal Target As Range) //Change this range
Set MyPlage = Range("YourRange") //Change this range
For Each Cell In MyPlage
Select Case Cell.Value
Case Is = "Withdrawn"
Cell.EntireRow.Interior.ColorIndex = 7
Case Is = "Postponed"
Cell.EntireRow.Interior.ColorIndex = 8
Case Is = "Terms Agreed"
Cell.EntireRow.Interior.ColorIndex = 4
Case Is = "Papers Rec"
Cell.EntireRow.Interior.ColorIndex = 3
Case Else
Cell.EntireRow.Interior.ColorIndex = xlNone
End Select
Next
End Sub
http://ccm.net/faq/8847-excel-vba-a-macro-to-change-the-color-of-a-row http://dmcritchie.mvps.org/excel/colors.htm