ConditionValue オブジェクト (Excel)

データ バーの条件付き書式ルールに対して、最短の棒と最長の棒がどのように評価されるかを表します。

注釈

ConditionValue オブジェクトは、DataBar オブジェクトの MaxPoint プロパティまたは MinPoint プロパティのいずれかを使用して返されます。

Modify メソッドを使用して、既定の設定 (最短の棒に最低の値、最長の棒に最高の値) から評価の種類を変更できます。

例

次の例は、データの範囲を作成し、範囲にデータ バーを適用します。 範囲には非常に低い値と高い値があるため、中間の値のデータ バーの長さが似ていることがわかります。 中間値を明確にするために、サンプル コードは ConditionValue オブジェクトを使用して、しきい値が百分位に評価される方法を変更します。

Sub CreateDataBarCF() 
 
 Dim cfDataBar As DataBar 
 
 'Create a range of data with a couple of extreme values 
 With ActiveSheet 
 .Range("D1") = 1 
 .Range("D2") = 45 
 .Range("D3") = 50 
 .Range("D2:D3").AutoFill Destination:=Range("D2:D8") 
 .Range("D9") = 500 
 End With 
 
 Range("D1:D9").Select 
 
 'Create a data bar with default behavior 
 Set cfDataBar = Selection.FormatConditions.AddDatabar 
 MsgBox "Because of the extreme values, middle data bars are very similar" 
 
 'The MinPoint and MaxPoint properties return a ConditionValue object 
 'which you can use to change threshold parameters 
 cfDataBar.MinPoint.Modify newtype:=xlConditionValuePercentile, _ 
 newvalue:=5 
 cfDataBar.MaxPoint.Modify newtype:=xlConditionValuePercentile, _ 
 newvalue:=75 
 
End Sub

メソッド

プロパティ

関連項目

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。