- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
回復 7# leefing - Sub Ex()
- 'With Range("F2:F" & Rows.Count).SpecialCells(xlCellTypeVisible).FormatConditions
- '上式 為F欄中有資料數值的儲存格: 設定格式化條件 可節省系統資源.
- With Range("F2:F" & Rows.Count).FormatConditions '整列 設定格式化條件 消耗系統 資源較大
- .Delete '刪除全部設定格式化條件
- .Add Type:=xlCellValue, Operator:=xlLess, Formula1:="=RC[11]" ' '條件一
- 'Add 的 參數可錄製得到,
- 'RC[11]: 為[欄名列號表示法] 工作表指令->工具->選項->一般 勾選 [欄名列號表示法]
- .Item(1).Interior.ColorIndex = 35 '圖樣顏色
- .Item(1).Font.ColorIndex = 10 '文字顏色
- .Add Type:=xlCellValue, Operator:=xlGreater, Formula1:="=RC[11]" '條件二
- .Item(2).Interior.ColorIndex = 38
- .Item(2).Font.ColorIndex = 13
- End With
- End Sub
複製代碼 |
|