+ Reply to Thread
Results 1 to 3 of 3

Macro to advance Graph Ranges To Accommodate new month

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Macro to advance Graph Ranges To Accommodate new month

    Hi,

    Can anyone please advise me of the macro code required to create a new month on my graphs i.e. have a macro button in cell ‘A1’ to advance the ranges of the four graphs to accommodate the new month’s data and delete the first set of data in my range in column ‘B’ only leaving the last 12 months data i.e. columns ‘B’ to ‘M’.

    Ideally to stop the month being advanced in error is it possible to have a simple password in order to run the macro?

    P;lease see attached sample file.

    Any assistance would be greatly appreciated

    Many thanks in advance

    Rob

    N.B. Excel version 2010
    Attached Files Attached Files
    Rob

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Macro to advance Graph Ranges To Accommodate new month

    So instead of complicating matters with VBA, I think it is easier to restructure your data to have a data tab, a processing tab and a reporting tab.

    The data tab can look identical to the columns A:M. The processing tab can pull over JUST the prior 12 months, so it would use the offset feature and indirect or count. Basically it would only grab the most recent data so you can have it all and NOT need VBA.
    Then the reporting tab would just be a tab with your charts.

    Would that not work for you?

    I mean, obviously VBA will work, but the above method will automatically update AS you add more data.

    Something along the lines of this:
    http://chandoo.org/wp/2009/10/15/dyn...t-data-series/
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to advance Graph Ranges To Accommodate new month

    mikeTron,

    many thanks for your suggestion, I will check the link out and see if it meets my requirements

    Thanks again

    Rob

+ 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. macro for month named ranges
    By freshfruit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2014, 05:50 PM
  2. [SOLVED] The macro is not flexible enough to accommodate the date input
    By BNCOXUK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2013, 06:20 AM
  3. Macro to accommodate the chart size
    By parekhharsh_j in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2012, 08:30 AM
  4. Advance to new month macro???
    By pril in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-29-2008, 09:08 AM
  5. Replies: 5
    Last Post: 07-21-2005, 02:05 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