jnikodym
asked on
Excel VBA, Bar Chart. Change bar color based on cell value
I have a bar chart in Excel. The chart is displaying data from Column C and D. Column C is a job description and column D is estimated hours to complete the job. In Column E i have some text with Categories. Each category has its own color. I would like the bars in my chart to be color coded based on the category they are in. Is this possible to do using some VBA code in Excel?
ASKER
I don't want to do it manually. I have a button on the sheet that has vba code behind it that automatically creates the excel gantt chart. It all works great, but i would just like to be able to categorize the bar lines with colors.
Without a sample workbook, it is harder to give a solution in this case - but in your scenario, if you are NOT using a regular built-in Excel chart, you might be able to use conditional formatting on your gantt chart (depending on how you produced your gantt chart).
ASKER
I am using a stacked bar chart which you can manipulate a little to make it a gantt chart. I just need the correct vba code to step through the bars to look for a certain value in my data set and color the bars based on that value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, can you post an example workbook?