+ Reply to Thread
Results 1 to 12 of 12

Needed...formula for fixed total....

Hybrid View

  1. #1
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Needed...formula for fixed total....

    Backup your data and run: YTDTotals
    I assumed you are working with whole numbers (that can be changed if not).

    Sub YTDTotals()
        Dim nRow As Long, nLastRow As Long, nTotal As Long
        
        nLastRow = Cells(Rows.Count, "A").End(xlUp).Row
        Range("E2:E" & nLastRow).ClearContents
        For nRow = 2 To nLastRow
            nTotal = Cells(nRow, "F") _
                    - Cells(nRow, "G") _
                    - Cells(nRow, "H") _
                    - Cells(nRow, "I") _
                    - Cells(nRow, "J") _
                    - Cells(nRow, "K") _
                    - Cells(nRow, "L") _
                    - Cells(nRow, "M") _
                    - Cells(nRow, "N") _
                    - Cells(nRow, "O") _
                    + Cells(nRow, "S")
            Cells(nRow, "E") = nTotal
            Range("F" & nRow & ":S" & nRow).Value = ""
        Next nRow
    End Sub

  2. #2
    Registered User
    Join Date
    04-18-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Needed...formula for fixed total....

    Unfortunately this has not worked....the totals in column E go back to 0 when columns F-O,S are cleared...
    Last edited by Bembs21; 05-11-2012 at 11:29 AM.

+ 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