Sub 宏1() Set d = CreateObject("script" />
乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>VBA</em>识别单元格的字体颜色-vba excel 颜色表,excel vba实例

<em>VBA</em>识别单元格的字体颜色-vba excel 颜色表,excel vba实例

作者:乔山办公网日期:

返回目录:excel表格制作


这个好像不能实现,要改属性到是可以实现。


Sub 宏1()
    Set d = CreateObject("scripting.dictionary")
    For i = 1 To [A65536].End(3).Row
        For n = 1 To Len(Cells(i, 1))
            ss = Cells(i, 1).Characters(Start:=n, Length:=1).Font.ColorIndex
            d(ss) = d(ss) & Mid(Cells(i, 1), n, 1)
        Next
        brr = d.items
        For x = 0 To UBound(brr)
            Cells(i, x + 2) = brr(x)
        Next
        d.RemoveAll
    Next
    Set d = Nothing
End Sub

如果VBA代码算出来的数值在A1:D10区域,将这些数值设置为黄色字
Range("A1:D10").Font.ColorIndex = 6

a=Cells(j, i).Font.ColorIndex '字体颜色
b=Cells(j, i).Interior.ColorIndex '单元格颜色

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网