做个按钮,或者到命令窗口执行
Dim t As Table= Tables("表A")
Dim r As Row
For i As Integer = 60 To 130 Step 10
Dim value As Integer = i
Dim cnt As Integer = 1
Dim idx As Integer = t.FindRow("lwan1a=" & i)
If idx > -1 Then
Dim k As Integer = idx + 20
If k > t.Rows.count-1 Then
k = t.Rows.count-1
End If
For j As Integer = idx+1 To k
r = t.Rows(j)
If r("wan1a") = "★" Then
value += 1
If cnt < 0 Then
cnt = 1
Else
cnt += 1
End If
Else
value -= 1
If cnt > 0 Then
cnt = -1
Else
cnt -= 1
End If
End If
r("lwan1a") = value
If Math.Abs(cnt) = 5 Then
t.Rows(idx)("lll") =cnt
Exit For
End If
Next
End If
Next