+ Reply to Thread
Results 1 to 4 of 4

Vba sum help please

  1. #1
    Registered User
    Join Date
    09-22-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Post Vba sum help please

    Please see attachements for data...

    i have a macro which imports this data periodically (when the macro is run.. another one of these sheets is added) from another workbook and formats it accordingly, end result being what you see in the attachements.. this is run twice a month, around the 15th and the 30th.

    the trouble i am having is trying to sum the totals for each new sheet (columns E,F,G)

    my original thought was to use a named range, produced by VBA, however i now know that is not what i require. as you can see sheet name "31_07_2011" is more recent than sheet name "15_07_2011"

    yet sheet name"15_07_2011" holds the same totals as "31_07_2011"

    example code is as follows..

    refers to suming the total of hours in column E

    Please Login or Register  to view this content.
    i need something which will sum these columns including the blanks, and will find the end of the data in that column, not the first blank. and then sum the values in that column beneath the last entry of data.

    any ideas?

    thanks in advance....

    Trev.
    Attached Images Attached Images
    Last edited by T-rev; 09-27-2011 at 11:56 AM.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Vba sum help please

    Why not upload the workbook for someone here to work with instead of pictures?
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

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

    Re: Vba sum help please

    Is it possible to attach the spreadsheet instead of the screen-shot? You can use a loop to add the hours till it reaches the last row and to get the last row you can use the "usedrange.count" option.

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Vba sum help please

    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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