Hello all -
Hoping to get some assistance from the resident experts. I want to color code a bar chart based on the color of the cell. I have the following code and it works fine with the following exception: when I add a conditional formatting for a cell based a value, the color will change based on that value. When I execute the code, the bar graph will not change color. The only time the color will change is when I use the 'fill color' option. Any help is greatly appreciated.
Here is the code:
![]()
Sub ColorBar() Dim i As Long, rng As Range, chrt As Chart Set chrt = ActiveSheet.ChartObjects(1).Chart Set rng = ActiveSheet.Range("B1:G1") For i = 1 To rng.Cells.Count chrt.SeriesCollection(1).Points(i).Format.Fill.ForeColor.RGB = _ rng.Cells(i).Interior.Color Next i End Sub
Bookmarks