Databar.AxisPosition (Excel)

Returns or sets the position of the axis of the data bars specified by a conditional formatting rule. Possible return values are xlDataBarAxisAutomatic - Display the axis at a variable position based on the ratio of the minimum negative value to the maximum positive value in the range. Positive values are displayed in a left-to-right direction. Negative values are displayed in a right-to-left direction. When all values are positive or all values are negative, no axis is displayed, xlDataBarAxisMidpoint - Display the axis at the midpoint of the cell regardless of the set of values in the range. Positive values are displayed in a left-to-right direction. Negative values are displayed in a right-to-left direction, xlDataBarAxisNone - No axis is displayed, and both positive and negative values are displayed in the left-to-right direction.

The axis for data bars is displayed only when the AxisPosition property is either xlDataBarAxisAutomatic or xlDataBarAxisMidpoint, and when there are negative values in the range of values specified with a data bar conditional formatting rule. If the conditional formatting rule is created programmatically, the default value for the AxisPosition property is xlDataBarAxisNone. If the conditional formatting rule is created by using the user interface, the default value for the AxisPosition property is xlDataBarAxisAutomatic.


ActiveCell.FormatConditions(1).AxisPosition = xlDataBarAxisAutomatic