返回列表 上一主題 發帖

[發問] 使用VBA程式自動設定格式化條件變成無法變色

[發問] 使用VBA程式自動設定格式化條件變成無法變色

使用VBA程式自動設定格式化條件變成無法變色.

     來源範圍 = "$" & "D" & "$" & 數字          '帶入此變數設定格式化條件變成無法變色
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
        Formula1:=(來源範圍)                                                            '帶入此變數設定格式化條件變成無法變色
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Font
        .Color = -16383844
        .TintAndShade = 0
    End With
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 13551615
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False

請問各位先進是那裡出錯? 請您教導,謝謝! 原物料量內控表.rar (243.24 KB)

雖然不是正解,但多學一招,謝謝你!

TOP

        靜思自在 : 每天無所事事,是人生的消費者,積極、有用才是人生的創造者。
返回列表 上一主題