+ Reply to Thread
Results 1 to 31 of 31

Macro needed for multiple series of data to plot unique charts

  1. #1
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Red face Macro needed for multiple series of data to plot unique charts

    Help!

    My husband (jhelliar) is pretty good with excel but he says I am better with macros so can't help me.

    I've got a macro which works to reproduce infinite numbers of charts based on a template, but the chart I now want to plot has 6 series of data.

    The data is in rows, with 6 columns to one series. At the moment, my current macro is running the main data (exam results) to produce unique graphs, but series 2-6 is still coming from row 2. I need all the data to come from the same row.

    Does this make sense?

    I can attach a similar table if needs be, but the current one has lots of protected information in it (children's names and exam results etc).

    Current macro I'm using is:

    Please Login or Register  to view this content.
    Can this one be edited?
    Last edited by ehelliar; 04-23-2011 at 11:55 AM.

  2. #2
    Registered User
    Join Date
    04-19-2011
    Location
    DE, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro needed for multiple series of data to plot unique charts

    To me it seems like your row is defined here:

    Please Login or Register  to view this content.
    If this is the case, you need your 2 to change dynamically with n while still being 2 for your first data set. Am I correct?

    If so, dim a new variable i and try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Thanks rman.

    I thought that was going to be the problem area with the macro. It had to be the code rather than the template.

    I'll edit the macro (and put in what you have written) and try that.

    Thanks a lot

  4. #4
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    It's not happy.

    As I've got data rows 122 - 150 sorted out (don't ask!) I've asked it to do charts 122 and 123, but it's trying to reproduce row 1 repeated times!

  5. #5
    Registered User
    Join Date
    04-19-2011
    Location
    DE, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro needed for multiple series of data to plot unique charts

    oops, posted too soon......i'll try to dig more.

  6. #6
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Thanks rman - I'm really grateful. I've been playing with it for the last couple of days and I can't figure it out!

    E

  7. #7
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    It's this part that it doesn't like but I don't know why - it's never been a problem before!

    Please Login or Register  to view this content.
    OK - I've figured out why this line is a problem - it's trying to recreate the same student's chart over and over again, so would therefore have the same name. So that part of the code is OK but it's higher up with the numbering.

    :S
    Last edited by ehelliar; 04-20-2011 at 04:55 PM. Reason: Used my brain!

  8. #8
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Does anyone else have any ideas?

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    You are applying the revised formula to series 1 every time.
    You need to increment the series.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  10. #10
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Ahhh great. Will try that

    Thanks x

  11. #11
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Sorry guys - it still doesn't like it

    This is what I have got at the moment

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    I've tried fiddling with various parameter settings with the macro and I still can't get it to work.

    Really getting frustrated now!!!

  13. #13
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    post example workbook so we can see exactly what is going on.

  14. #14
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Quote Originally Posted by Andy Pope View Post
    post example workbook so we can see exactly what is going on.
    Thanks Andy. I would be very grateful if you/someone/I could get this to work! I've removed all student's names so it should be OK (data protection act wise!)

    E
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    The ones with the best data in are rows 122-150, so I'm putting 122 -123 as sn and fn in the input box.

  16. #16
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    try this

    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Thanks,

    It's happier but there's still an issue here:

    Please Login or Register  to view this content.

  18. #18
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    It's bombs when processing row 176 as there is not data. The copied chart ends up retaining the your name.

    If your change the default value for the last student to process then it will work. It did students 1 to 174 for me.

  19. #19
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Mine won't duplicate any due to the code issue:

    Please Login or Register  to view this content.
    Hmmmm

    P.S. If I hover over objSeries it comes up with objSeries = nothing.

    Is this right?
    Last edited by ehelliar; 04-21-2011 at 12:27 PM. Reason: P.S. added!

  20. #20
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Sorry,

    I think it's now working.

    I restarted excel (as it crashed) and it seems happy

    Thanks soooooo much for your help so far.

    E

  21. #21
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Spoke too soon.

    It's still faulting on:

    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    The charts are correct if I plot them individually (ie setting the input box to the same number) but it will NOT produce the next row down. I am closer Than I was as all data series are there but it's not perfect.

    Sorry!

  23. #23
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Quote Originally Posted by ehelliar View Post
    Spoke too soon.

    It's still faulting on:

    Please Login or Register  to view this content.
    I'm still at a loss as to why it won't work. I can sometimes get it to produce 3 graphs in a row, but at other times it won't even do 1.

    It's still highlighting the above code as an error.

    Any other ideas?

  24. #24
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    I am grateful for the help so far but I still can't get it to work properly.

    Any ideas on what is still wrong?

  25. #25
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    It must be something with your setup or file as it runs for me.

    Do you actually need to produce individually charts?
    have you considered using 1 chart with the ability, via formula, to see any students results.

  26. #26
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Hi Andy,

    Thanks for the reply - I am very grateful.

    I need to print each chart, and have them available for teachers to look at and compare.

    It does keep faulting on the same section, but if it works OK for you then I'll perservere! Reading a book on macros at the moment - see if I can get to the bottom of it . . .

    Thanks,

    E

  27. #27
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    I'm wondering if all those non contigous range references are causing problems.

    When I try the code in xl2010 it is a lot less stable.

    Could you create chart only data that used contiguous ranges?

  28. #28
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    It might be but I haven't had a problem with it before in the other sheets (before it was amended - handling one series of data).

    My HoD uses a similar document and it makes life LOTS easier to have all the data in the same format as his so that very few changes need to be made.

    I thought, to begin with, that it was because I had filtered the data but that hasn't helped either.

    It's still the same line faulting. What does that line mean?

  29. #29
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro needed for multiple series of data to plot unique charts

    You only need to build a contigous range for the Student series, as you have already done the Marks.

    See attached.
    Attached Files Attached Files

  30. #30
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Ahhhh thanks Andy - I will try that.
    Last edited by ehelliar; 04-23-2011 at 07:47 AM.

  31. #31
    Registered User
    Join Date
    04-20-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Macro needed for multiple series of data to plot unique charts

    Andy, thanks soooo much for your help.

    Have got it working now

+ 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