Posted 4 April 2019, 8:13 pm EST
Hi Yiannis,
I got the following response from the development team:
t looks like some of the check box cells got checked and unchecked at some point in the designer, and so those cells have residual “0” values causing the DataRowCnt to show the unexpected value.
Here is code I added in the button after setting ActiveSheet that finds the last cell with data, sets it active and shows the value it contains:
Dim row As Long
Dim col As Long
Dim value
For row = fpSpread1.DataRowCnt To 1 Step -1
For col = 1 To fpSpread1.DataColCnt
If fpSpread1.GetText(col, row, value) Then
fpSpread1.row = row
fpSpread1.col = col
GoTo done
End If
Next col
Next row
done:
fpSpread1.Action = ActionActiveCell
MsgBox (Str$(fpSpread1.DataRowCnt) & " – Last Cell with a value: (" & Str$(col) & “,” & Str$(row) & ") = " & fpSpread1.Text)
You can use that code to find the cells with the “0” values and then use the ClearRange method with data only flag to clear the values.
Thanks,
Deepak Sharma