标签:orm with code 技术分享 select 设置 color style alt
以下是一些range的简单用法
Sub aa() ‘-=============================================== ‘给B列设置填充颜色为黄色 Range("B:B").Select With Selection.Interior .Color = 65535 End With ‘给A1录入"我是孙悟空" Range("A1").Select ActiveCell.FormulaR1C1 = "我是孙悟空" ‘--============================================== ‘不相邻区域,使用,表示加选 设置颜色为黑色 Range("F13:G14,I13:I14").Select With Selection.Interior .Color = 15 End With ‘--============================================== ‘不相邻区域,空格的话表示2个区域相交,设置为绿色 Range("K14:K21,K18:M21").Select With Selection.Interior .Color = 5287936 End With ‘--============================================== ‘单元格的相对引用写法 设置为橙色 Range("F4:G8").Range("a1").Select With Selection.Interior .ThemeColor = xlThemeColorAccent6 End With ‘--============================================== ‘range的变量支持 Dim s% s = 3 Range("A" & s).Select Range("c3:e5")(2).Select With Selection.Interior .ThemeColor = xlThemeColorLight2 End With ActiveWorkbook.Save ‘保存 End Sub
在EXCLE中运行后截图如下:
标签:orm with code 技术分享 select 设置 color style alt
原文地址:http://www.cnblogs.com/OliverQin/p/6198441.html