• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to fix the color of bars as per the companies designation

Hi,

I want to create a bar chart and the color of bars should be as per the designation of the company.

IF the company is target, then it should be Yellow,
if its a Comps, then it should be grey
And if its a peer avg. it should be green.

Details are in the attached spreadsheet.

Regards,
Manish
 

Attachments

  • Fixing the Color of Bars as per their Designation.xlsx
    22.9 KB · Views: 1
Hi Vletm,

This is looking fine

I just need one small iteration, regarding the dynamic range selection that part is fixed, because I have more than 100 charts in the spreadsheet. In that case I will have to use the similar code for each and every chart.

Hence, can you help me in fixing the color only. And dont link the colors in the Macro with any excel, try writing the color codes in the macro itself.

Regards,
Manish
 
msharma864512
That 'part' cannot be fixed because You wanted some ... dynamic.
Did You write something about 100 chart in the sheet?
... and You would use same code for all of those ... that could be a challenge with my sample code.
It would be much smoother for You, if You could have written - what do You really would like to get?
>> the color fixing procedure >>
#1 You could delete those lines where code get those colors
#2 Modify wanted color values for bg_0 ... bg_e3
 
msharma864512
That 'part' cannot be fixed because You wanted some ... dynamic.
Did You write something about 100 chart in the sheet?
... and You would use same code for all of those ... that could be a challenge with my sample code.
It would be much smoother for You, if You could have written - what do You really would like to get?
>> the color fixing procedure >>
#1 You could delete those lines where code get those colors
#2 Modify wanted color values for bg_0 ... bg_e3

This is very helpful,

Will use the same code for all my charts and make amendments as necessary.
 
This is very helpful,

Will use the same code for all my charts and make amendments as necessary.

Hi Vletm,

I have been able to fix the dynamic range issue with the Offset function for all my charts, now i am only struggling with fixing the colors, even though If I keep the same way i.e. defining the colors through excel range, I can work with that.. but i am not sure how to modify the code to only fix the colors and delete rest of the code
 
msharma864512
Your now i am only struggling with fixing the colors ...
Seems You skipped my hint - how to do that part?
I got the part to fix the colors. however the issue is regarding fixing column wherein we have mentioned that the company is a target, peer avg or Comps. Because, in my data set I have multiple tables similar to the one I sent to u..

I have attached the sample excel.
 

Attachments

  • Fixing the Color of Bars as per their Designation.xlsx
    23.6 KB · Views: 2
msharma864512
Seems that You didn't get my message ...
I already once solved Your thread
... which (Your written thread) seems to be something else that You would like to use later.
Hint: Your sample file should be as near as Your real file.
Maybe someone else would solve this like new thread.
 
msharma864512
Seems that You didn't get my message ...
I already once solved Your thread
... which (Your written thread) seems to be something else that You would like to use later.
Hint: Your sample file should be as near as Your real file.
Maybe someone else would solve this like new thread.
Sure vletm, will create a new thread
 
Back
Top