Hi Justchris,
sorry, had not seen your reply to your second post.
For it to work for g6:g20, modify my code above to something likethis:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 And (Target.Row >= 6 And Target.Row <= 20) Then
Cells(Target.Row, 5) = Cells(Target.Row, 5) + Cells(Target.Row, 7)
End If
End Sub
And If you want it to work for a button, then use something like this:
Assign the following code to the button. I am assuming that you will use a button from the control toolbox
Private Sub CommandButton1_Click()
For i = 6 To 20
Cells(i, 5) = Cells(i, 5) + Cells(i, 7)
Next
End Sub
- Mangesh
Bookmarks