Sub bianse() Dim a As Integer a = 1 Do While Cells(a, 1) <> "" If Cells(a, 3) >= Cells(a, 1) And Cells(a, 3) <= Cells(a, 2) Then Cells(a, 3).Interior.ColorIndex = 4 Cells(a, 4) = "安全" Else Cells(a, 3).Interior.ColorIndex = 3 Cells(a, 4) = "预警" End If a = a + 1 Loop End Sub