+ Reply to Thread
Results 1 to 6 of 6

creating multiple charts with macro

  1. #1
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    creating multiple charts with macro

    Dear all,

    is it possible to write a macro so that several (about 50) graphs are made based on the same template?
    Or if you could refer me to an analogous topic where I could use the code with some adjustments (I might just be able to do that ).

    It's quite straightforward, but time-consuming doing it manually ...

    It's about bird species (the title)
    numbers of observed individuals in a certain month
    the months as labels for the x-axis.
    add values and remove legend

    I can record a macro, but it will just perform the same thing over and over, not shifting to the next species and data ...
    Attached Files Attached Files
    Last edited by furor; 09-21-2011 at 05:20 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: creating multiple charts with macro

    This needs testing:
    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    Re: creating multiple charts with macro

    Hi Thomas,

    this almost does the job perfectly!
    However, I get an error message on line
    Please Login or Register  to view this content.
    .

    Also, is it possible to create them in the active worksheet? When I copy the graph and adjust the size to fit in Word, the axis labels diminish in size and become unreadable.

    I also added this line but is doesn't work (adding values through re-recording the macro):
    ActiveChart.HasDataTable = False

    Many thanks!

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: creating multiple charts with macro

    Sure. The amended code puts them all in the sheet with the data. Unfortunately, they are one on top of the other, so as you copy each one to word, you could delete the chart from Excel and have a handy means of tracking your progress. Also, the reason the code was bombing was there was a gap at the bottom of your data where you put in aantal soorten (total species?). In any case, removing the blank row takes care of the problem.
    Please Login or Register  to view this content.
    See attached book.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-04-2011
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003/2007
    Posts
    14

    Re: creating multiple charts with macro

    Thanks man, this works great!

    I owe you

    aantal soorten = number of species (in Dutch)

  6. #6
    Registered User
    Join Date
    10-22-2011
    Location
    LONDON
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: creating multiple charts with macro

    Hi,

    I'm not sure if you can help, i'd appreciate it it a lot if you could. I need a chart for multiple merchants to track suspicious sales. e.g i would chart certian sales for a month (30 or 31 days) and look for spikes.

    i need to produce around 50 charts a day to identify these spikes and evidence tht we have monitored a certian merchants.

    The format is the first column has merchant names and then each row contains represents each days figures going through the merchant. in the charts i'd like to have the date represented in the axis e.g 01/10/2011 etc. As I need to look at and document each of these and to produce multiple tables is very time consuming. i'd appreciate any help with this.

    attached is an example of the data/format. Any help would be appreciated.

    All the best,

    Steve
    Attached Files Attached Files

+ 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