+ Reply to Thread
Results 1 to 5 of 5

Copy sums to Summary page

Hybrid View

  1. #1
    Registered User
    Join Date
    01-25-2011
    Location
    OKC, OK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Copy sums to Summary page

    I have a project that I am working on that is an hours summary. I have created one workbook and want to have the first worksheet be my summary page. There will be perhaps as many as 200 worksheets that follow containing a list of dates and hours worked with a sum at the bottom. The length of these columns will vary on all the worksheets. What I WANT to do is to copy the sums from each of the worksheets to a specific cell on my summary sheet. I know this may sound simple, but I simply have not found a way to do this. I have attached the workbook.
    Attached Files Attached Files

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

    Re: Need HELP: Copy sums from multiple worksheets to a Summary page in same workboo

    Here you go. I was thinking about putting error handling in but decided why bother. YOU WILL WANT TO MAKE SURE THAT THE ROWS IN COLUMN A ON THE SUMMARY SHEET MATCH THE SHEETS IN ORDER.
    Option Explicit
    
    Sub MasterCode()
    Dim ws As Long
    
    For ws = 2 To Worksheets.Count
        Sheets(ws).Range("B65536").End(xlUp).Copy
        Sheets("Summary").Range("C65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
    Next ws
    Application.CutCopyMode = False
    End Sub

  3. #3
    Registered User
    Join Date
    01-25-2011
    Location
    OKC, OK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Need HELP: Copy sums from multiple worksheets to a Summary page in same workboo

    THANK YOU!

    Not only did you solve my problem, you actually FORCED me to figure out how to write/record a MACRO!

    As I am continually updating and inputting more hours on projects and adding project worksheets as I run across them, I will need to make sure that my worksheets are in order as I have them listed on the Summary Page and then rerun the macro to update when I'm finished, correct?
    Last edited by WizArtist; 02-03-2011 at 07:47 PM.

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

    Re: Need HELP: Copy sums from multiple worksheets to a Summary page in same workboo

    If you are using excel 2007 you will need to add the developer tab.
    File -> Excel Options -> Show Developer Tab...

    Then in the developer tab click Visual Basic. When the window pops up right click on This Workbook -> Insert -> Module

    Copy and Paste the code i gave you. Save. Exit Visual Basic. Go back to your sheet and go to developer tab. Click Macro. Run the macro.

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

    Re: Copy sums to Summary page

    Glad i can help and welcome to the darkside . Its amazing what you can accomplish with macros.

    As I am continually updating and inputting more hours on projects and adding project worksheets as I run across them, I will need to make sure that my worksheets are in order as I have them listed on the Summary Page and then rerun the macro to update when I'm finished, correct?
    Correct, as long as the summary sheet corresponds with the order of the other sheets you can add worksheets and the macro will continue to include the new sheets.

+ 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