Posted 8 September 2017, 1:46 pm EST
I use databinding and add Unbound Row which will display totals using Formula:
'Set up data source
'Add unbound column
'Add totals row
.Cells(.RowCount - 1, intTotalsGridColumn).Text ="Totals:"
.Cells(.RowCount - 1, intSumColumn).Formula = "SUM(R1C" & (intSumColumn + 1).ToString & ":R" & (.RowCount - 1).ToString & "C" & (intSumColumn + 1).ToString & ")"
If at the time DataSource doesn't have any records Spread will contain only one Summary (unbound) row and formula above wouldn't work. I can bypass setting formula at this time and try to set it in event when row is being added.
Is there any way to set up a formula using RC reference when Data source doesn't have any rows?