0
範囲の条件付き書式設定をdatabar
で追加するVBAスクリプトを作成しようとしています。私は下のコードを書いていますが、databar
の色をどのように変更するのか分かりませんし、異なる境界を提供しています。データバーオブジェクトの書式設定
奇妙なことに、minpoint
を0に設定しても機能しますが、を名前付き変数(タイプinteger
に設定)に設定できません。どこが間違っていますか?
Set bar = rangeTest.FormatConditions.AddDatabar
'assign max value + 1 for databar upper bound
maxValue = Application.WorksheetFunction.Max(rangeTest) + 1
With bar
.BarFillType = xlDataBarFillSolid
.BarColor = RGB(189, 215, 238) 'error thrown here (Object doesn't support this property)
End With
With rangeTest.FormatConditions(1)
.MinPoint.Modify newtype:=0 'xlConditionValueAutomaticMin
.MaxPoint.Modify newtype:=xlConditionValueAutomaticMax 'error thrown here (invalid procedure call)
End With