jsuarez199
New Member
- Joined
- Jun 21, 2013
- Messages
- 3
Hi guys,
Ive been struggling with this...
I have a table with a range of values (AE6:AE15) for which I want to show data bars inside the cells. I want the data bar configuration to be the shortest bar to correspond to the largest value and viceversa. However, this column has both negative and positive values, and it would be great if I could have the negative values in red and the positives in blue. This is what I have tried so far... Any ideas??
Thanks in advance!!
Ive been struggling with this...
I have a table with a range of values (AE6:AE15) for which I want to show data bars inside the cells. I want the data bar configuration to be the shortest bar to correspond to the largest value and viceversa. However, this column has both negative and positive values, and it would be great if I could have the negative values in red and the positives in blue. This is what I have tried so far... Any ideas??
Code:
<code style="margin: 0px; padding: 0px; font-style: inherit;">Range("AE6:AE15").Select Selection.FormatConditions.AddDatabar Selection.FormatConditions(Selection.FormatConditions.Count).ShowValue = True Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority With Selection.FormatConditions(1) .MinPoint.Modify newtype:=xlConditionValueLowestValue .MaxPoint.Modify newtype:=xlConditionValueHighestValue End With For N = 6 To 15 If Cells(N, 31) >= 0 Then Cells(N, 31).Select With Selection.FormatConditions(1).BarColor .Color = 13012579 .TintAndShade = 0 End With Else Cells(N, 31).Select With Selection.FormatConditions(1).BarColor .Color = 5920255 .TintAndShade = 0 End With End If Next
</code>
Last edited: