-
Jan 3rd, 2018, 10:54 AM
#1
Thread Starter
Addicted Member
[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
-
Jan 3rd, 2018, 03:13 PM
#2
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
-
Jan 3rd, 2018, 03:42 PM
#3
Thread Starter
Addicted Member
Re: Excel 2000 spreadsheet/workbook question
This will do just fine - Happy new year to you and yours! Thanks again
Solved
Jeff
Originally Posted by westconn1
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|