+ Reply to Thread
Results 1 to 3 of 3

Macro to apply subtotals to multiple sheets

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5

    Macro to apply subtotals to multiple sheets

    Hi, I have a macro that splits a list into multiple sheets with each sheet containing, and named according to, the value in a certain column.

    I would like to create a second macro which will apply subtotals to all open sheets , for each change in column D it should SUM column K.

    I've tried using two routines that I found on other forums but they're giving me errors - perhaps someone could have a look at the code below and let me know what's wrong? I'd rather learn what's wrong and correct it than just ask someone to write it for me!

    The error is: 'Subtotal method of range class failed', I don't know if this is because I've set the range incorrectly or what.

    Please Login or Register  to view this content.
    VBA subtotals.xlsx

    Thanks, Scott.
    Last edited by Scotbot; 03-20-2012 at 07:29 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to apply subtotals to multiple sheets

    Welcome to the forum.

    Please visit the forum rules once again and edit your post to include code tags. Thanks.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    03-20-2012
    Location
    UK
    MS-Off Ver
    2010
    Posts
    5

    Re: Macro to apply subtotals to multiple sheets

    This worked:

    Please Login or Register  to view this content.

+ 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