Sub chiefzjh() Dim s%, e%, t$, c As Boolean c = True: s = 2: e = 2: t = [b2] Do While Cells(s, 2).Value <> "" If Cells(e, 2).Value <> t Then If c Then Range("a" & s & ":b" & e - 1).Interior.ColorIndex = 33 t = Cells(e, 2): s = e: e = e + 1: c = Not c Else e = e + 1 End If Loop End Sub追问