求一段excel vba代码,将excel表格中所有的字体颜色替换成相应表格的填充色颜色,并去掉填充色??急。。

如题所述

第1个回答  2014-02-07
Sub test()
On Error Resume Next
For Each cell In Sheet1.UsedRange
a = cell.Interior.ColorIndex

cell.Select

Selection.Font.ColorIndex = a

cell.Interior.ColorIndex = -4142

Next
end sub本回答被提问者采纳
第2个回答  2014-02-07
Private Sub CommandButton2_Click()
Dim rag As Range
For Each rag In UsedRange
rag.Font.ColorIndex = rag.Interior.ColorIndex
rag.Interior.ColorIndex = -4142
Next
End Sub
第3个回答  2014-02-07
你把你的EXCEL文件发上来,我帮你弄。
相似回答