Hi guys, how do I modify this macro so it can pick colours from columns B&C, instead of A?
'Name macro
Sub ColorChartColumnsbyCellColor()
'The With ... End With statement allows you to write shorter code by referring to an object only once instead of using it with each property.
With Sheets("Sheet1").ChartObjects("Chart 1").Chart.SeriesCollection(1)
'Save chart data source range from first chart on worksheet Sheet1
Set vAddress = ActiveSheet.Range(Split(Split(.Formula, ",")(1), "!")(1))
'Iterate through each cell in data source range
For i = 1 To vAddress.Cells.Count
'Copy color from cell to bar
.Points(i).Format.Fill.ForeColor.RGB = ThisWorkbook.Colors(vAddress.Cells(i).Interior.ColorIndex)
'Continue with next cell
Next i
End With
End Sub
'Name macro
Sub ColorChartColumnsbyCellColor()
'The With ... End With statement allows you to write shorter code by referring to an object only once instead of using it with each property.
With Sheets("Sheet1").ChartObjects("Chart 1").Chart.SeriesCollection(1)
'Save chart data source range from first chart on worksheet Sheet1
Set vAddress = ActiveSheet.Range(Split(Split(.Formula, ",")(1), "!")(1))
'Iterate through each cell in data source range
For i = 1 To vAddress.Cells.Count
'Copy color from cell to bar
.Points(i).Format.Fill.ForeColor.RGB = ThisWorkbook.Colors(vAddress.Cells(i).Interior.ColorIndex)
'Continue with next cell
Next i
End With
End Sub