EXCEL中如何用VBA将某个单元格填充颜色?

如题所述

如你的数据在A列,代码如下。
sub aa ()
for x =1 to range("A65536").end(xlup).row'建立循环
if cells(x,1)=6 then'判断单元格值
cells(x,1).interior.colorIndex = 3'单元格值等于6时,该单元格填充红色
end if
next x
end sub
温馨提示:答案为网友推荐,仅供参考
相似回答