Hi, guys,

I have a CheckList with three columns.

The first column is a checkbox type.

The second column contains numbers.

The third column contains numbers too.

I am trying to do the following:

- Sum together cell values from the second column for the rows whose checkboxes are checked (Good Tokens)
- Sum together cell values from the third column for the rows whose checkboxes are not checked (Penalties)
- Calculate the final score by subtracting Penalties from Good Tokens

To achieve this, I have written the following code

me.period=100 Dim maxscore, score As Double Dim penalty As Double Dim finalScore as Double Dim i, count As Integer For i =0 To Listbox1.ListCount - 1 If Listbox1.CellCheck(i, 0) Then count = count + 1 score=score + val(ListBox1.Cell(i,1)) End If Next For i =0 To Listbox1.ListCount - 1 maxscore=maxscore + val(ListBox1.Cell(i,1)) Next For i =0 To Listbox1.ListCount - 1 If Listbox1.CellCheck(i,0)=False then count = count + 1 penalty=penalty + val(ListBox1.Cell(i,2)) End If Next finalScore=score - penalty //MsgBox "Check count : " + Str(count) Label1.text="Completed:" + " "+ str(count) Label2.text="Missed:" + " " + str(ListBox1.ListCount-count) //Label3.text="Score:" + str(score) Label6.text="Score:" + " " + str(round(finalScore/maxscore*100)) + "%" Label7.text= str(round(finalScore/maxscore*100)) + "%"

Apparently, I've done something wrong because the final results are incorrect.

I am more than sure that the code to loop through the rows with unchecked checkboxes is incorrect.

I would appreciate any help.

Thank you in advance,

Val