+ Reply to Thread
Results 1 to 5 of 5

Vba - change column graph color gradients with macro

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Guildford, UK
    MS-Off Ver
    Excel 2003
    Posts
    23

    Vba - change column graph color gradients with macro

    Hi there.

    I have a simple column chart in a 2007 excel doc, and the bars have "2-stop" color gradient on them. Color stop 1 is bright orange, and color stop 2 is black.

    I want to create a macro that changes the bright orange color to bright red using VBA.
    ___

    I found this website, but I cant make sense of it - http://code.msdn.microsoft.com/offic...-with-ae123477

    ___

    Ideally I want something of that looks roughly like:

    ActiveChart.SeriesCollection(1).Interior.Fill.Gradient.ColorStop1 = RGB (255, 0, 0)

    ___

    Any help is appreciated.
    Last edited by xandermacleod; 09-26-2012 at 07:25 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,476

    Re: Vba - change column graph color gradients with macro

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-10-2012
    Location
    Guildford, UK
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Vba - change column graph color gradients with macro

    perfect! thankyou!

  4. #4
    Registered User
    Join Date
    09-23-2007
    Posts
    54

    Re: Vba - change column graph color gradients with macro

    Hi Andy.

    I have a related question. I have a line chart with 3 connected points. You can select a single point (excel 2010) and give that a "gradient line" fill. So in VBA, I'd like to make one end (stop @ 0) a given RGB color, and the opposite stop @ 1 another RGB color. I think the default is 3 stops, so I'd also have to make sure there are only the 2 end stops. I can then move to the next pont, do the same thing continuing with the color I left off with, and turn the whole line into a slowly changing color legend that I have prescribed.

    I figured it out manually, just don't know the VBA code

    Can you help?

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Vba - change column graph color gradients with macro

    spacely,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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