Sub 填充颜色()
Dim a As Long
a = 3
Do While Cells(a, 2) <> "" And Cells(a, 5) <> ""
If Cells(a, 2) < 0 Then
Cells(a, 2).Interior.Color = vbRed
Else
End If
If Cells(a, 5) < 0 Then
Cells(a, 5).Interior.Color = vbRed
Else
End If
a = a + 1
Loop
End Sub
Private Sub CommandButton1_Click()
Dim i
For i = 3 To 12
If Cells(i, 2) < 0 Then
Cells(i, 2).Select
Selection.Interior.ColorIndex = 3
End If
If Cells(i, 5) < 0 Then
Cells(i, 5).Select
Selection.Interior.ColorIndex = 3
End If
Next
Sub 填充颜色()
Dim a As Long
a = 3
Do While Cells(a, 2) <> "" And Cells(a, 5) <> ""
If Cells(a, 2) < 0 Then
Cells(a, 2).Interior.Color = vbRed
Else
End If
If Cells(a, 5) < 0 Then
Cells(a, 5).Interior.Color = vbRed
Else
End If
a = a + 1
Loop
End Sub