excel vba中连续相连的填充下一单元格颜色

1.范围为L20:BB倒一(遇到空列时,跳过空列)
2.上下单元为连续时填充下单元颜色

第1个回答  2017-02-22
Sub ss()
    n = Cells(Rows.Count, 12).End(3).Row
    arr = Array(6, 14, 33)
    For i = 12 To 54
        k = Cells(n, i) Mod 3
        For j = n - 1 To 20 Step -1
            If Cells(j, i) = "" Then Exit For
            k1 = Cells(j, i) Mod 3
            If k = k1 Then
                Cells(j + 1, i).Interior.ColorIndex = arr(k)
            End If
            k = k1
        Next
    Next
End Sub

第2个回答  2017-02-22
你用哪个版本的EXCEL?本回答被提问者采纳
相似回答