Autosum Updating...

ravi10

New Member
Joined
Mar 20, 2011
Messages
2
Hi, I have a problem with the autosum function not updating.

I have data such as:

a 1
b 2
c 3
total 6 (this uses the autosum)

I have a form which allows the user to insert data before the total.

So if the user inserted d 4 then this is the result:

a 1
b 2
c 3
d 4
total 10

At the moment i can insert data but the autosum doesnt update so in the example above the total would stay at 6, an error does appear tell me to
"update formula to include cells", what i want to know is how to do this automatically ie i dont want the user to have to do this.

PS my code for when the user click on the add button on my form is:
Code:
Private Sub CommandButton1_Click()
Dim iRow As Long
Dim ws As Worksheet
 
Set ws = Worksheets("Sheet1")
Set r = Cells(Rows.Count, "A").End(xlUp)
r.Offset(-3, 0).EntireRow.Insert
 
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(-4, 0).Row
 
ws.Cells(iRow, 1).Value = Me.TextBox1.Value
ws.Cells(iRow, 2).Value = Me.TextBox2.Value
 
Unload UserForm1
End Sub
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

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