Spartan920
New Member
- Joined
- Sep 14, 2012
- Messages
- 9
Any help on this would be much appreciated.
I'd like to change the the color of the bar (meter) in my bar chart using VBA. The actual bar chart is located on "Sheet1" and I'd like to be able to change the color from cell "A3" in "Sheet2".
Please include the following colors as well:
Case "RED": .RGB = vbRed<o></o>
Case "YELLOW": .RGB =RGB(255, 255, 109)<o></o>
Case "GREEN": .RGB = RGB(41, 247, 46)<o></o>
Case "GREY": .RGB = RGB(127, 127, 127)
Here's the coding I'm using that didn't work.
Sub Chart1_Color()<o></o>
With Sheets("Sheet1").ChartObjects("Chart 1").Fill.Interior.Color<o></o>
Select Case UCase(Sheets("Sheet2").Range("A3").Value)<o></o>
Case "RED": .RGB = vbRed<o></o>
Case "YELLOW": .RGB =RGB(255, 255, 109)<o></o>
Case "GREEN": .RGB = RGB(41, 247, 46)<o></o>
Case "GREY": .RGB = RGB(127, 127, 127)<o></o>
End Select<o></o>
End With<o></o>
EndSub
Thanks
I'd like to change the the color of the bar (meter) in my bar chart using VBA. The actual bar chart is located on "Sheet1" and I'd like to be able to change the color from cell "A3" in "Sheet2".
Please include the following colors as well:
Case "RED": .RGB = vbRed<o></o>
Case "YELLOW": .RGB =RGB(255, 255, 109)<o></o>
Case "GREEN": .RGB = RGB(41, 247, 46)<o></o>
Case "GREY": .RGB = RGB(127, 127, 127)
Here's the coding I'm using that didn't work.
Sub Chart1_Color()<o></o>
With Sheets("Sheet1").ChartObjects("Chart 1").Fill.Interior.Color<o></o>
Select Case UCase(Sheets("Sheet2").Range("A3").Value)<o></o>
Case "RED": .RGB = vbRed<o></o>
Case "YELLOW": .RGB =RGB(255, 255, 109)<o></o>
Case "GREEN": .RGB = RGB(41, 247, 46)<o></o>
Case "GREY": .RGB = RGB(127, 127, 127)<o></o>
End Select<o></o>
End With<o></o>
EndSub
Thanks