##### Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

# Automatically change sum

0

i have sum of a1+a3+a4 in a7 and want b1+b3+b4 in b7

now i add a2 in sum of a7 (a1+a2+a3+a4) is it possible that b7 change according to a7 like (b1+b2+b3+b4)

0

Hi Chetan Vera and welcome to the Forum.

To make a similar formula in B7, first click in A7 (with your new formula), The cell will get a thick border (say green). If you see a small square in the bottom right of the cell, that's the "fill handle" *. Click and hold that then drag it into B7 until the thick border surrounds A7:B7. Release the mouse and you'll find the formula in B7 is like A7 but referring to cells in B7. release.

You can also fil down in a similar way.

* If that small square fill handle isn't present:

1. Click File > Options
3. Under Editing Options, check the Enable fill handle and cell drag-and-drop box.

Hope this helps. If so, please remember to mark this Answer as Selected.

### Discussion

Hi again. Did that help? Not bothering to reply?
John_Ru (rep: 6212) Aug 15, '23 at 9:25 am
0

Hello Chetan Vora,

John has provided a solution but you haven't responded to let him know if that is the method you want.

If you want use VBA you could use a Worksheet_Change event. To do so add the following to the worksheet code window:

``````Private Sub Worksheet_Change(ByVal Target As Range)

If Target = Range("A7") Then
Range("A7").Copy Range("B7")
End If

End Sub``````

This code references the cells you state in your explanation. This code will only be triggered (run) when cell "A7" changes. When the formla in "A7" is changed it will be copied to cell "B7".

Please let John and I know which method you prefer; and mark that answer as selected.

Cheers   :-)

### Discussion

@Willie- that'sagood alternative but the basic level of the question suggested to me that this user is unlikely to be familiar with VBA
John_Ru (rep: 6212) Aug 21, '23 at 2:19 am