+ Reply to Thread
Results 1 to 2 of 2

Cannot change color of line in chart with VBA

  1. #1
    Registered User
    Join Date
    12-09-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    1

    Cannot change color of line in chart with VBA

    I am creating a chart and it is a combination of columns and lines with markers. I would like to change the color of the lines but can't seem to do so. I can change the color of the columns.

    For the line I am using:
    ActiveChart.SeriesCollection("name").Format.Line.ForeColor.RGB = RGB(112, 48, 160)

    For the column I am using:
    ActiveChart.SeriesCollection("name").Format.Fill.ForeColor.RGB = RGB(112, 48, 160)

    I have tried using Fill for the line but all it does is change the color of the markers, not the line. I have also tried to change the type from xlLineMarkers to xlLine and then change color - this does not work. I was able to change the line to a column, and then change the color but when I change it back to a line the color returns to the automatic one.

    I am using Excel 2007.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Cannot change color of line in chart with VBA

    Try the following:
    Please Login or Register  to view this content.
    Lewis

+ 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. change the color of a line in a chart
    By amartino44 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-30-2013, 12:36 PM
  2. Change color of line in line graph
    By ptk in forum Excel General
    Replies: 4
    Last Post: 11-17-2011, 07:57 AM
  3. how to change line color and transparancy in XY scatter chart
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2010, 09:54 AM
  4. Replies: 4
    Last Post: 07-05-2006, 11:10 AM
  5. Change Line Column Chart to Line Area chart
    By recchie in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-23-2005, 11:40 AM

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