Probably easy but im unsure how to word

Ichokuchi

New Member
Joined
Jul 6, 2018
Messages
37
Hello, like i said probably an easy thing to do but im not able to search properly for what I want to do, basically I would like to take a current total, and add to it when another cell total changes, except i already am seeing errors in what i want to do. So i think i want a macro so after all totals are confirmed entered correctly i can run macro and it will update a current cell total to add on totals of other cells. Im such a noob on this stuff but I learn fast and its for something im helping with at a job.

Thanks for any help in advance.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
.
Formula :

Code:
 =SUM(A2:A12)


Macro :

Code:
Option Explicit


Sub SumTotal()
    Sheet1.Range("D5").Value = "=Sum(A2:A12)"
End Sub



[Table="width:, class:head"][tr=bgcolor:#888888][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][th]
E
[/th][th]
F
[/th][th]
G
[/th][th]
H
[/th][th]
I
[/th][th]
J
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
1
[/td][td]Entries[/td][td][/td][td][/td][td]Total[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
2
[/td][td]
22​
[/td][td][/td][td][/td][td]
323​
[/td][td][/td][td]This formula in D2 allows for sum of entries from[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
3
[/td][td]
13​
[/td][td][/td][td][/td][td][/td][td][/td][td]A2 : A12 =SUM(A2:A12)[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
4
[/td][td]
44​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
5
[/td][td]
53​
[/td][td][/td][td][/td][td]
323​
[/td][td][/td][td]Or you can click this button for the same total.[/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
6
[/td][td]
24​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
7
[/td][td]
72​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
8
[/td][td]
95​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
9
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]


[tr=bgcolor:#FFFFFF][td=bgcolor:#888888]
10
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]
 
Upvote 0
Thing is i want the yearly total to add based on new monthly numbers which is why i said i think I need a macro to run after numbers are confirmed then it will just compare/add to those numbers type of thing.. does that make sense?
 
Upvote 0
.
There are two solutions in the post.

The first is a formula.

The second is a macro. Edit the range in the macro to suit.
 
Upvote 0
Doesn't work for what I am asking so its not a solution, i know how to sum cells. I'm not that noob=) what i am asking as i said above I want to take a current number say $15,320 as a base number (there will be several base numbers from prior yearly total) i want when the monthly numbers are adjusted a macro or script that i can run that will take the adjusted monthly numbers and add them to the total of the current yearly numbers, I dont believe the above formula does that does it? Because that looks like a basic sum formula to me which wouldn't do what I'm trying to accomplish. Sorry if it wasn't more clear, This is why I'm having hard time searching for it =(
 
Upvote 0
.
Yes your description was not very clear.

It would be best if you can post a sample of your workbook that can be downloaded. You can
use a cloud site like www.dropbox.com or similar. Then post the download link here.

Another method would be to post images of your worksheet.

In the worksheet (whether the sample workbook or image), provide a
BEFORE and AFTER example of what you are seeking.
 
Last edited:
Upvote 0
Well it's at work and boss wouldn't want me posting that.

So will try again as i believe it should be very basic i would think if i say it like this maybe. I want a base number to only be changed by running macro based on number in another cell. Like i stated yearly total to be added to after monthly total for that line item is changed and confirmed (which why i was thinking in a macro after numbers are confirmed) so once i figure out how to do it for one line, i can do it for all.
So say we have:
Monthly. Yearly
beer cost: 5250 23500

I want to after making sure my numbers are confirmed i can run the macro and then yearly will be adjusted to new number of 28750.
Once i figure out base macro i would just adjust it to do every line i need. Im sorry for being a pain just trying to be pro active and figure out how to do stuff on the weekend before going back to work tomorrow. Thanks for any input or solutions I do appreciate peoples time and effort to help me.
 
Upvote 0
Im an idiot after reading some other forums your way is close to working except the cell i want the number added with other for a total is the same cell i want the number displayed. So like in your example i dont have a d5 i want the a1 to give me that and a12 total but in a12. Is this possible even? Thanks again.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top