+ Reply to Thread
Results 1 to 5 of 5

VBA code to change Excel chart bar colors as per cell colors

  1. #1
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Question VBA code to change Excel chart bar colors as per cell colors

    Dear all,
    Please refer the attachment. I am tying to color each bars of excel chart as per its corresponding data cell color. Below is the code i am using below code.
    Problem here is this code colors all the chart bars to single colors (Thats first cell color). Whats the mistake i am doing here..?
    Please help me to get it corrected.

    And also i want to color only chart 1 and chart 2 (Horizontal Bars). Currently it colors all the charts.. This is the first time i am coding with charts.

    Please Login or Register  to view this content.
    Thanks for Support.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: VBA code to change Excel chart bar colors as per cell colors

    You could try with this code:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Re: VBA code to change Excel chart bar colors as per cell colors

    Thanks a lot for your response..It works like a charm...
    One small request, i need to color only chart1 and chart2...How do i put that condition..?

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: VBA code to change Excel chart bar colors as per cell colors

    Excuse me, I didn't see that you wanted to color only some charts, try this code:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  5. #5
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Re: VBA code to change Excel chart bar colors as per cell colors

    Works cool..Thanks Thanks thanks a lot..! Have a gr8 day sir..!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Changing cells and column chart colors based on cell colors
    By HDeuce in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2016, 11:43 AM
  2. Replies: 3
    Last Post: 10-21-2015, 03:51 PM
  3. Change Default Colors in Excel 2010 Chart Series?
    By parodytx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2015, 12:07 PM
  4. Replies: 1
    Last Post: 06-18-2015, 07:58 PM
  5. Change bar chart fill colors to match the color of a random cell
    By gwbe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-03-2014, 08:12 PM
  6. Can I change the color of labels in a 3D pie chart to match cell colors?
    By Macphersonian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 12:07 PM
  7. Replies: 1
    Last Post: 07-04-2006, 04:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1