作者:乔山办公网日期:
返回目录: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 '单元格颜色