Results 1 to 4 of 4

Vba sum help please

Threaded View

  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

    
    Range("$E$4:E" & Cells.End(xlDown).Row).Name = "SumHrs"
    
        Range("A4").Select
            Selection.End(xlDown).Select
            Selection.Offset(1, 4).Select
            ActiveCell.Formula = "=SUM(SumHrs)"
            With Selection
            .NumberFormat = "0.00"
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlCenter
            Selection.Font.Bold = True
            End With
    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.

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