+ Reply to Thread
Results 1 to 9 of 9

create multiple x y charts, one for each column with the same x axis using excel-vba

  1. #1
    Registered User
    Join Date
    12-07-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2013
    Posts
    9

    create multiple x y charts, one for each column with the same x axis using excel-vba

    Hi,

    I've been working on the problem of automating the plotting of line diagrams. But I did not yet manage to solve it yet.


    I would need multiple charts one for each column (from E to R) using the same column (B) for the X axis. The ultimate aim is to be able to clean out the extreme or outlying values.

    Could anyone please help me with this problem, I would really appreciate it.


    Thank you!


    After recording a macro on one of the worksheets and editing the code I got the following:

    I edited it so only the name of the worksheet has to be changed because all the 30 worksheets I have to run this on have the same structure, but the best would be if it could run automatically for all the sheets in the actual file.

    Unfortunately it stops after the first graph giving me a runtime error.


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    Name column B Xaxis and columns E to R data

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Please consider adding a * if I helped.

  3. #3
    Registered User
    Join Date
    12-07-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    Thank you for the help, unfortunately it gave me a runtime error, although I specified the ranges.

    I am by the way looking for something like this: fig.png. And again thank you for your efforts!

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    If you just run the plot macro in the file i posted what happens exactly? i.e. just download, open, run the macro.

  5. #5
    Registered User
    Join Date
    12-07-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    On that file it runs perfectly, I do not have any idea why it won't work in the original document. It says: Location of object chart failed.

    This is how the graphs looked. In the next reply I have added the original file that I used and additional comments.

    screen.png
    Last edited by istvan60; 02-03-2015 at 01:01 PM.

  6. #6
    Registered User
    Join Date
    12-07-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    On that file it runs perfectly, I do not have any idea why it won't work in the original document. It says: Location of object chart failed or, Runtime error 1004, method ' Range of object'_Global failed

    I have attached the original file, and it would be more than perfect if it would plot the graphs referring to the same worksheet on one new wsheet.

    Attachment 374771

    Thank you very-very much for your efforts so far.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    Try this one - for the active sheet run the plot macro and it will insert a page with the charts on it.

    No need to name ranges etc - assumes data is in a nice table
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-07-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    Dear Brendan!

    I have edited it a bit, but it works perfectly thank you very-very much!

    All the best!

    I.

  9. #9
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    Please consider some * Add reputation.... and

    To mark the thread solved:
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    Many thanks
    Bren

+ 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] How do I plot multiple x-axis series in excel charts
    By bdorr in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-22-2018, 08:52 PM
  2. Replies: 3
    Last Post: 10-16-2014, 02:01 PM
  3. Replies: 3
    Last Post: 02-05-2012, 10:04 AM
  4. Replies: 0
    Last Post: 07-28-2011, 02:11 AM
  5. [SOLVED] Create and customize axis on all sides of charts
    By Nicholas in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-18-2006, 09:25 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