ExcelNooberino
New Member
- Joined
- Jan 2, 2019
- Messages
- 43
- Office Version
- 2016
- Platform
- Windows
Hello everyone,
I keep trying to achieve a formula that allows me to sum some cells in a different sheet than the one I wanted posted so I've developed a code such as this one below:
I keep getting syntax errors and so on no matter how I switch it up, I need some help!
I keep trying to achieve a formula that allows me to sum some cells in a different sheet than the one I wanted posted so I've developed a code such as this one below:
Sub SumData()
Dim LastRow As Long
Dim FirstRow As Long
LastRow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
FirstRow = Sheets("Sheet1").Range("H2").Row
Range("Home!A1") = Application.WorksheetFunction.SumIf(Range(Home!E" & FirstRow & ":Home!E" & LastRow & "), "EX20", Range(Home!H" & FirstRow & ":Home!H" & LastRow & "))
End Sub
I keep getting syntax errors and so on no matter how I switch it up, I need some help!