[RESOLVED] Excel 2000 spreadsheet/workbook question-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] Excel 2000 spreadsheet/workbook question

  1. #1

    Thread Starter
    Addicted Member habenero's Avatar
    Join Date
    Aug 2015
    Posts
    138

    Resolved [RESOLVED] Excel 2000 spreadsheet/workbook question

    This is so basic
    I have a workbook with sheets names :1-1-18 to 1-31-18
    I want to sum up a specific cell on each of those sheets but keep a running total on each of those sheets..
    I see examples for sheets that are ref'ed with the default "sheet1" to whatever - but really none to ref named sheets

    Thanks for your help on this EZ one
    Jeff

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,442

    Re: Excel 2000 spreadsheet/workbook question

    I want to sum up a specific cell on each of those sheets but keep a running total on each of those sheets..
    for vba, you can try like
    Code:
    For d = 1 To 31
        With Sheets("1-" & d & "-18")
            tot = tot + .Range("A6")    ' cell to sum
            .Range("h4").Value = tot    ' cell to hold running total
        End With
    Next
    i have not tested, change cell addresses to suit

    as this really only is good for when all the sheets have the values already filled, or needs to be run on a daily basis, probably better just to use a cell formula to add each days total to the previous days running total, this will always just update when any sheets are changed
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Addicted Member habenero's Avatar
    Join Date
    Aug 2015
    Posts
    138

    Re: Excel 2000 spreadsheet/workbook question

    This will do just fine - Happy new year to you and yours! Thanks again

    Solved

    Jeff

    Quote Originally Posted by westconn1 View Post
    for vba, you can try like
    Code:
    For d = 1 To 31
        With Sheets("1-" & d & "-18")
            tot = tot + .Range("A6")    ' cell to sum
            .Range("h4").Value = tot    ' cell to hold running total
        End With
    Next
    i have not tested, change cell addresses to suit

    as this really only is good for when all the sheets have the values already filled, or needs to be run on a daily basis, probably better just to use a cell formula to add each days total to the previous days running total, this will always just update when any sheets are changed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width