Hi,
Can anyone help me achieve the following? I want to be able to alter the fill colour of a specific bar (say to Red) depending on the label name which I want to choose from a from a dropdown list.
eg. I have a list of wards which have population values attached and are shown in a bar chart accordingly (all coloured Blue)... I want to pick a particular ward from a dropdown list and that particular bar changes to red ... if that makes sense?
I've found this vba snippet (see below) but I can't get it to work for just one particular chart, the dropdown bar value that I want to change is picked up from cell reference B2:B2 (dropdown list) by the way.
Any help you can give would be much appreciated ... Don
Sub LoopThroughCharts()
Dim sht As Worksheet
Dim CurrentSheet As Worksheet
Dim cht As ChartObject
Application.ScreenUpdating = False
Application.EnableEvents = False
Set CurrentSheet = ActiveSheet
For Each sht In ActiveWorkbook.Worksheets
For Each cht In sht.ChartObjects
cht.Activate
'Do something with the chart...
Next cht
Next sht
CurrentSheet.Activate
Application.EnableEvents = True
End Sub
Can anyone help me achieve the following? I want to be able to alter the fill colour of a specific bar (say to Red) depending on the label name which I want to choose from a from a dropdown list.
eg. I have a list of wards which have population values attached and are shown in a bar chart accordingly (all coloured Blue)... I want to pick a particular ward from a dropdown list and that particular bar changes to red ... if that makes sense?
I've found this vba snippet (see below) but I can't get it to work for just one particular chart, the dropdown bar value that I want to change is picked up from cell reference B2:B2 (dropdown list) by the way.
Any help you can give would be much appreciated ... Don
Sub LoopThroughCharts()
Dim sht As Worksheet
Dim CurrentSheet As Worksheet
Dim cht As ChartObject
Application.ScreenUpdating = False
Application.EnableEvents = False
Set CurrentSheet = ActiveSheet
For Each sht In ActiveWorkbook.Worksheets
For Each cht In sht.ChartObjects
cht.Activate
'Do something with the chart...
Next cht
Next sht
CurrentSheet.Activate
Application.EnableEvents = True
End Sub