+ Reply to Thread
Results 1 to 4 of 4

How to plot multiple charts from data

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    68

    How to plot multiple charts from data

    Hi everyone

    I've just signed up, so apologies if I do something wrong here!!

    I'm trying to write some VBA code to produce 8 charts based on 8 rows of data:

    data.png

    The code, so far, looks like this:

    Please Login or Register  to view this content.
    This code almost works. The idea is that I start with cell A1 selected (Data Type) and then when I run the code, it produces 8 charts, however, each chart has an extra series plotted, i.e. the first chart correctly plots the data specified in the range B4:M4, but the second chart plots data for the range B4:M5. This carries on throught the remaining charts, ending with the eighth chart having all 8 sets of data plotted (B4:M11).

    What I am trying to achieve is to have each chart plotting only one set of data, i.e the first chart should plot B4:M4, the second should plot B5:M5, the third should plot B6:M6, etc.

    I think the problem lies in the way I am specifying the source data in the line:

    Please Login or Register  to view this content.
    but I don't know how else to specify both the data labels on the axis and the actual data.

    I have also attached a sample spreadsheet, with the 'chart' macro so you can see how it currently works. Any suggestions that anyone can come up with would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: How to plot multiple charts from data

    Hello there,

    Try updating your code to look like the following:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-11-2012
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: How to plot multiple charts from data

    Thank you very much for the prompt response. I've just tried it out and it's working exactly as I want it.

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: How to plot multiple charts from data

    Great! Thanks for marking this thread solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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