+ Reply to Thread
Results 1 to 5 of 5

Macro to loop through multiple sheets and sum a certain range

  1. #1
    Registered User
    Join Date
    05-07-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro to loop through multiple sheets and sum a certain range

    Hi all

    I have a workbook with a menu tab (entitled "Menu") and multiple sheets afterwards, each with a list of numbers in column H. Can someone please provide a script to sum the range H2:H500 on all the sheets, and return the values to the B column of Menu? So for example B1 would have H2:H500 from Sheet 1, B2 would have H2:H500 from Sheet 2, etc for all the sheets. The name of the sheets is not always the same, so the macro would just cycle through them all in order until the end.

    Thanks in advance for any help!!

    Paul
    Last edited by Paul123qwe; 06-09-2014 at 10:15 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Macro to loop through multiple sheets and sum a certain range

    Please Login or Register  to view this content.
    Havent tested as not in excel
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Macro to loop through multiple sheets and sum a certain range

    Try this:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to loop through multiple sheets and sum a certain range

    This will also put the sheet names in column A.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    05-07-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro to loop through multiple sheets and sum a certain range

    Couldn't get 1st one to work but 2nd and 3rd work great, thanks a lot for the quick replies!

+ 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. [SOLVED] Loop codes through multiple sheets (not all sheets in workbook)
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-18-2014, 02:11 AM
  2. Macro to loop through multiple sheets
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2013, 02:41 AM
  3. [SOLVED] Macro to Copy range from multiple sheets and paste in new Workbook
    By cameron.beyers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2012, 01:00 PM
  4. Macro to set range permissions across multiple sheets
    By jamesmbrannan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2010, 05:46 AM
  5. Macro to Copy Formulas in Range to Multiple Sheets
    By wruwtrix in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2009, 04:09 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