+ Reply to Thread
Results 1 to 9 of 9

Combine Subtotal Macro

  1. #1
    Registered User
    Join Date
    01-18-2007
    Posts
    81

    Combine Subtotal Macro

    Hello

    I have the following code to subtotal column B (Which are dates) for a location, in a worksheet called “IRDUB52”.

    However, I have 3 other new locations, or worksheets now coming on (“IRDUB55”, “IRDUB60”, & “IRDUB65”).

    Rather than have a separate macro for each one, by just changing the worksheet name, can all four of these locations / worksheets, be combined into the macro below so as I only have to press one macro, & not 4 individual macros?

    Please Login or Register  to view this content.

    Cheers

  2. #2
    Registered User
    Join Date
    08-24-2007
    Posts
    35
    use this in the same workbook but make sure you have four sheets with your names “IRDUB52”, "IRDUB55”, “IRDUB60” and “IRDUB65” this will only work with each sheet being in the same format.

    Please Login or Register  to view this content.

    lemme know how you get on

  3. #3
    Registered User
    Join Date
    08-24-2007
    Posts
    35
    format wasn't the right word, layout is the right word

  4. #4
    Registered User
    Join Date
    01-18-2007
    Posts
    81
    Sorry, that didn't work.

    I attach a copy of the workbook with your code in it.

    Cheers

  5. #5
    Registered User
    Join Date
    01-18-2007
    Posts
    81
    Sorry.

    I attach it now.
    Attached Files Attached Files

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Harlequin,

    Since the formatting, and data locations are the same on these sheets, the macro can be easily be modified to take the Worksheet name as an argument. Another macro can then call all 4 sheets using a command button.

    Revised Macro
    Please Login or Register  to view this content.
    Macro to Call Multiple Worksheets
    Please Login or Register  to view this content.
    SIncerely,
    Leith Ross

  7. #7
    Registered User
    Join Date
    01-18-2007
    Posts
    81
    Sorry Leith.

    I tried to use that but it didn't work. Can you insert it into that spreadsheet I attached?

    Many thanks

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Harlequin,

    The macros have been installed in the attached workbook.

    Sincerely,
    Leith Ross
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-18-2007
    Posts
    81
    Leith.

    You're a genius.

    Many Thanks

+ 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