1.用VBA
2.。区域为B10:Z15
3。单元格内容为AA填充单元格为红色
4.。单元格内容为QQ填充单元格为黄色
5.。单元格内容为QP填充单元格为青色
对,用VBA
追答Sub 填色()
Set quyu = Application.InputBox("请选择单元格地址然后确定", "", "range", , , , , 8)
For Each cel In quyu
If cel = "QQ" Then cel.Interior.ColorIndex = 6
If cel = "QP" Then cel.Interior.ColorIndex = 8
If cel = "AA" Then cel.Interior.ColorIndex = 3
Next
End Sub
放大图片查看操作。
使用inputbox可以很方便的控制单元格区域,等同于selection。