autosum

bibbyd01

Board Regular
Joined
Sep 10, 2008
Messages
113
Is there any way to have a cell sum values, without the = sign?

For instance, I have a list of numbers from a printout that needed to be added together. I would normally do =5+9+69+56+95+5 but I was wondering if there's a way of just typing into the cell 5+9+69+56+95+5?

I'm trying to dumb the process down at someone's request, and I'm sure I've seen something somewhere that lets me do this.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Jubjab

Well-known Member
Joined
Jan 3, 2007
Messages
995
You can also start with just a plus (or minus) sign. Excel will then add the = programatically.
 
Upvote 0

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,197
I think I prefer jubjab's solution but if you don't you could try this:

Right click the tab of the worksheet you want to work with, choose 'view code' and paste the following.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If InStr(Target, "+") Then
        Application.EnableEvents = False
        Target.Formula = "=" & Target.Value
        Application.EnableEvents = True
    End If
End Sub

This only takes account of sums entered with plus signs, so if there's any variation likely, it may have to be rewritten to accommodate.
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Just for fun, here's another

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Variant, i As Integer, t As Integer
Application.EnableEvents = False
X = Split(Target.Value, "+")
For i = LBound(X) To UBound(X)
    t = t + CInt(X(i))
Next i
Target.Value = t
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,190,809
Messages
5,983,040
Members
439,815
Latest member
yoswosz

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
Top