将如下代码写在 Public Sub Workbook_Open下,渐变的区域按正常设置好条件格式,并将区域地址添加别名 KB_BMX,添加后可直接使用不用改VBA代码。
- Excel.GetLock()
- AW = Excel.ActiveWorkbook
- Range = AW.ActiveWorksheet.Range
- With Range("KB_BMX").FormatConditions(0).Interior
- .Pattern = Pattern.Solid
- .PatternColorIndex = 20
- .ThemeColor = Themes.ColorSchemeIndex.Accent3
- .TintAndShade = 0.9
- End With
- Excel.ReleaseLock()
复制代码
KB_BMX.rar
(3.14 KB, 下载次数: 133)
|
|
hessen