Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
Why is this not working
I want to add all the values in column B from row 4 down to last cell with data and the past the TOTAL in Cell B2
I want to add all the values in column B from row 4 down to last cell with data and the past the TOTAL in Cell B2
Code:
Private Sub CommandButton1_Click()
[FONT=arial]Dim myRange[/FONT][FONT=arial]
myRange = ActiveSheet.Range("B4", Range("B4").End(xlDown))
Range("B2") = WorksheetFunction.Sum(myRange)
End Sub[/FONT]
Last edited: