exel 单元格数值变化,及时改变另一列显示背景颜色

Sub Worksheet_Change(ByVal Target As Range)
    Dim i As Integer
    Dim j As Integer
    Dim r As Integer

    r = 1000

    For i = 1 To r

         If Cells(i, 6) = "" Or Cells(i, 6) = 0 Then
             Cells(i, 2).Interior.ColorIndex = 0
         End If
         If Cells(i, 6) > 0 Then
             Cells(i, 2).Interior.ColorIndex = 42
         End If
    Next
End Sub
原文地址:https://www.cnblogs.com/shortail/p/5473140.html