+ Reply to Thread
Results 1 to 9 of 9

Graphing with data from multiple sheets

  1. #1
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Graphing with data from multiple sheets

    I've never done any graphing with macros earlier.

    However, it would be nice to know how to perform operations like this one.
    If I have say 'x' number of sheets and I want to trace and compare the graphical evolution of values on two particular columns on each sheet, what would be the simplest way to code it?

    In the attached file, I have only three sheets. But, I am more looking for something that will help me easily loop through 100-150 sheets.
    Assuming I insert a new sheet, could values from there be traced on to the new sheet too?

    Also, is there any was of making it optional? Say, I want to view only graphs from particular sheets to compare them.
    If the values were on the same sheet, I could have easily used the sort function to display a dynamic graph for me.

    Thank you for your help in advance!
    Attached Files Attached Files
    Last edited by AliGW; 07-12-2017 at 02:51 AM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Graphing with data from multiple sheets

    This application takes advantage of the fact that Excel Tables add a series every time you add a column. Keep the control panel sheet and Table sheet and make sure they are the first two sheets in the book. Add as many data sheets as you want.

    Click the make data sheet and it creates the table which, in turn, creates the chart. You will get a series for every sheet in the workbook from sheet 3 on.

    On the control panel, you get a listing of sheets and whether to show the sheet on the chart. By default, this is true. Click false and the table column is hidden which means the series on the chart is hidden. Click true and it is unhidden again.

    The big issue is that there is no provision to add a sheet and just append it. You have to start from scratch when you add or delete sheets.

    I abbreviated the data for the sake of testing.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Re: Graphing with data from multiple sheets

    There seems to be some problem with this part of the code.

    It highlights ".FullSeriesCollection" part of the code and pops up an error message which reads method or data member not found.

    Please Login or Register  to view this content.


    Also, could anybody recommend a good source to pick up charting via macros?
    Last edited by hegdep; 07-13-2017 at 05:01 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Graphing with data from multiple sheets

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Re: Graphing with data from multiple sheets

    Attachment 527646

    Please see the screenshot, I am very much in compliance of the rules. The coded part is very much in between
    Please Login or Register  to view this content.
    tags.
    The website seems to have a bug!

    My bad, I wasn't using the syntax correct. Can you delete this post and the previous one and please let the thread continue?
    I am new on here. Still figuring my way around.
    Last edited by hegdep; 07-13-2017 at 05:02 AM.

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Graphing with data from multiple sheets

    You have Excel 2010 - Microsoft changes the rules whenever they release a new version of Excel. I use FullSeriesCollection - you should use SeriesCollection (without the Full). I don't know why Microsoft thought it was necessary to make this particular change and break people's code.

    Just be aware that when you upgrade, your code will no longer work since SeriesCollection has been "depreciated" in Microsoft-speak.

  7. #7
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Re: Graphing with data from multiple sheets

    Thanks a ton for your help!
    Even though a little complicated, it works perfectly fine! It was a great exercise for a noob like me, to split the code apart and learn.
    I just have one question, though. How do you get your chart to hide the column when the Boolean reads false and not display it on the chart?

    Basically, when a detail is false on the control panel, that column should hide on the "Table" sheet. How do I make this happen?

    Or, if it is a part of ModClearTable3, could you please explain it to me in greater detail?

    I really appreciate your help on this. I am sorry for getting back to you this late. I was tied up with a bunch of other things.
    Last edited by hegdep; 07-19-2017 at 06:03 AM.

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Graphing with data from multiple sheets

    I probably could hide the rows with False, but then how would you access them to turn them back on?

    It would probably be easier to use the table as a source for a pivot table and filter on TRUE in the show column.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Re: Graphing with data from multiple sheets

    Thanks a ton!One final question, though. How do you create a new chart that takes in data from a dynamically changing table?

+ 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. Graphing data from multiple sheets as a series
    By Siesser in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 04-04-2017, 10:32 AM
  2. Replies: 1
    Last Post: 07-23-2015, 10:15 PM
  3. Replies: 4
    Last Post: 07-01-2015, 09:41 AM
  4. Replies: 1
    Last Post: 08-11-2012, 05:43 PM
  5. Graphing data across multiple columns?
    By magician13134 in forum Excel General
    Replies: 5
    Last Post: 10-20-2010, 01:33 AM
  6. [SOLVED] Graphing and plotting multiple data series
    By rpeas in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-01-2010, 09:22 AM
  7. Replies: 4
    Last Post: 08-17-2006, 01:30 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