+ Reply to Thread
Results 1 to 2 of 2

Plotting graph excel VBA

  1. #1
    Registered User
    Join Date
    02-16-2012
    Location
    sa
    MS-Off Ver
    Excel 2007
    Posts
    80

    Plotting graph excel VBA

    Good day,

    I would like to plot multiple lines on one line graph. However, the source data all comes from one column range. This gives me an error when using the .Chart.SeriesCollection code.

    My source data looks like this:


    A B C
    Jan-12 Name1 10
    Feb-12 Name1 15
    Mar-12 Name1 5
    Jan-12 Name2 20
    Feb-12 Name2 10
    Mar-12 Name2 8


    Based on the above I would like to plot values (in cloumn C) for name1 and Name 2 for the months jan-mar on the same graph in order to compare them.

    How do I define this in vba?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Plotting graph excel VBA

    This isn't the kind of program I do much of, so I'm not very good at it. In my experience, whether in VBA or using spreadsheet formulas, these kind of problems are more about the arrangement of data in the spreadsheet. My own approach to this would be to arrange the data differently in the spreadsheet. Something like (comma delimited):
    Please Login or Register  to view this content.
    Rearranging the data like this in VBA might be easiest using filters. If you examine the sample code at the end of this help document (http://msdn.microsoft.com/en-us/libr.../ff838238.aspx ), he uses the advanced filter tool to copy subsets of the larger data set into another range. You may want to do something similar with your project: filter and copy the various subsets of the data into a table like I show above. Then you should be able to easily use this range as the data source for you chart.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. [SOLVED] Plotting a standard bar graph on the same axes as a stacked bar graph
    By Shearwater in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-01-2014, 04:59 AM
  2. [Solved!]Help with plotting Km on graph...
    By graymonkey44 in forum Excel General
    Replies: 2
    Last Post: 03-02-2012, 03:58 PM
  3. Excel Graph Plotting
    By callsaravananr in forum Excel General
    Replies: 4
    Last Post: 07-12-2009, 12:28 PM
  4. plotting a line graph on a bar graph
    By mufan in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-02-2009, 03:29 PM
  5. Plotting Graph
    By csl3 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-27-2009, 12:43 AM

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