+ Reply to Thread
Results 1 to 4 of 4

Macro to grab multiple rows and sum on different sheet

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro to grab multiple rows and sum on different sheet

    Hey Guys,

    I am trying to grab data from sheet 1 and bring to sheet 2 based on certain criteria. I have attached an example to help with my explanation (most likely terrible/confusing)!

    On Sheet 1 there is a list of buildings down column A and years across the top row. I would like the macro to do the following:
    1. If there is activity for the building, regardless of the year, then grab the building name and take to sheet 2
    2. For all the buildings with activity, take the total of the activity and deposit the total in the column of they last year of activity on sheet 2 (in the corresponding year).
    3. Insert 4 rows between the returned buildings
    4. Add the following to inserted rows Outside, Inside, Improvements to rows 1, 2, 3, respectively


    I also added a 'final' tab on my sample to help show what I want the final product to look like after the macro has run.

    I appreciate the help and thanks in advance!

    Attachment 273266
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to grab multiple rows and sum on different sheet

    Try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-05-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro to grab multiple rows and sum on different sheet

    Sorry for the delayed response, I have been sick a couple days.

    Thanks for the help! It works exactly how I was hoping, but I do have a small follow up question. Can you help me update the code if I named the range (A2:P9) on 'Sheet1' "RangeA"?

    I am having trouble because on my real problem the buildings start on row 180 and amounts start in column AU(44) with the years going across on row 3. I tried to simplify for ease of explanation but my lack of knowledge is now inhibiting me . Do you think naming the range will help with my problem or should I just start on the coordinates above.

    Thanks.
    Last edited by Steveb03; 10-30-2013 at 11:17 AM.

  4. #4
    Registered User
    Join Date
    12-05-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro to grab multiple rows and sum on different sheet

    Still looking for some help on this problem. Thanks.

+ 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 to add Multiple rows in same sheet
    By qbzee007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2013, 03:13 PM
  2. Replies: 6
    Last Post: 04-26-2013, 03:45 PM
  3. Replies: 2
    Last Post: 01-21-2013, 02:26 PM
  4. Replies: 0
    Last Post: 12-28-2012, 07:06 AM
  5. Replies: 1
    Last Post: 07-24-2012, 06:03 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