+ Reply to Thread
Results 1 to 4 of 4

Sum Across Sheets

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Sum Across Sheets

    I use a worksheet as a template which is used to generate 12 sheets for each month, by copying the template to newly created sheets.
    The sheets are named as months

    The template contains formulae which usually copy across properly.
    However some of the formulae are used to generate yearly summaries by using formulae such as
    SUM(JANUARY:DECEMBER!Z1). In these cases the sheet names are rendered as #REF!

    The code for copying the template is :-
    Please Login or Register  to view this content.
    I have tried workarounds without success so I would be very grateful for some help to copy the formulae across properly.

  2. #2
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: Sum Across Sheets

    I have seen a fault in the code I quoted, it should be-
    Please Login or Register  to view this content.
    I am sorry about this and I hope that it has not wasted someones time. The problem still remains

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: Sum Across Sheets

    I have realised that my problem was caused because the old sheets were deleted before the code was executed. This meant that the template sheet was referring to non existent sheets hence the #REF!.
    I therefore turned to the following piece of code run after the new sheets were created.
    Please Login or Register  to view this content.
    This simply puts a string in AQ6 not the formula which would look like MARCH!AQ6 + APRIL!AQ6 + MAY!AQ6 etc, accumulating as the months progress.
    I think I have misunderstood FormulaR1C1
    can anyone help
    John

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Sum Across Sheets

    Perhaps a way to overcome this would be to try the following trick...
    if you add a blank worksheet at the start and end of your data sheets, and call them Start and End, then when you enter your calcs, you could just enter =sum('start:End'!C12) or whatever your references are. this way, you can add or remove sheets as needed, and it will add across all the sheets you need it to, and keep the totals as the data sheets change. make sure your "Master" sheet is before the Start sheet though
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 1
    Last Post: 10-04-2013, 04:21 AM
  2. Replies: 17
    Last Post: 02-01-2013, 12:20 PM
  3. [SOLVED] Excel vba copy data from general sheets and organize them in separate sheets.
    By excelsubb in forum Excel Programming / VBA / Macros
    Replies: 40
    Last Post: 01-24-2013, 08:01 AM
  4. Replies: 2
    Last Post: 01-18-2012, 05:08 AM
  5. [SOLVED] Macro for filter on protected workbook that works for all sheets, no matter what sheets are named?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2006, 02:35 PM

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