hello, there are a few issues with this code, so any help is very welcome:
Sub SumBeforeBlank()
Dim oSheet As Object
Dim oCell As Object
Dim nSum As Double
Dim nRow As Long
oSheet = ThisComponent.CurrentController.ActiveSheet
For nRow = 1 To oSheet.Rows.Count
oCell = oSheet.getCellByPosition(0, nRow)
If oCell.Type = com.sun.star.table.CellContentType.EMPTY Then
oSheet.getCellByPosition(1, nRow).setValue(nSum)
nSum = 0
Else
nSum = nSum + oCell.getValue()
End If
Next nRow
End Sub
![help1|646x500](upload://.jpeg
The yellow highlight is where I need the sums for the blocks of data.
Thank you.