返回列表 上一主題 發帖

請問vba要怎樣寫才能讓文字顏色交叉呈現@@

回復 1# s13030029
請參考
Sub test()
    Dim mycolor%, x$, cell As Range
    For Each cell In Range([A1], [A65536].End(3))
        If cell.Value <> x Then
            mycolor = IIf(mycolor = 5, 10, 5)
            x = cell.Value
        End If
        cell.Font.ColorIndex = mycolor
    Next cell
End Sub

TOP

        靜思自在 : 有智慧才能分辨善惡邪正;有謙虛才能建立美滿人生。
返回列表 上一主題