(若是和其他不同软件互动之问题 请记得一并填写)
软件:Office
版本:2010
我想要用for循环把17*30 共 2个Frame Data , 用色阶表示
以下程式有错 , 请大大帮忙看一下
Sub Click()
For j = 0 To x
For k = 1 To y
Range("j:k").Select
Next k
Next j
Range("k").Activate
Selection.FormatConditions.AddColorScale ColorScaleType:=3
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueLowestValue
With Selection.FormatConditions(1).ColorScaleCriteria(1).FormatColor
.Color = 7039480
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValuePercentile
Selection.FormatConditions(1).ColorScaleCriteria(2).Value = 50
With Selection.FormatConditions(1).ColorScaleCriteria(2).FormatColor
.Color = 8711167
.TintAndShade = 0
End With
Selection.FormatConditions(1).ColorScaleCriteria(3).Type = _
xlConditionValueHighestValue
With Selection.FormatConditions(1).ColorScaleCriteria(3).FormatColor
.Color = 8109667
.TintAndShade = 0
Office file连结如下
https://www.dropbox.com/s/0gu117c5wc6u7r1/Frame%20VBA.xlsx?dl=0