一样的代码哦。
Tables("表A").sort="成绩"
DataTables("表A").ReplaceFor("名次", Nothing, Tables("表A").Filter)
Dim mc As Integer=1
Dim count As Integer=IIF(Tables("表A").Rows.count-1<8,Tables("表A").Rows.count-1,7)
For i As Integer=0 To count
If i>0 AndAlso Tables("表A").Rows(i)("成绩") <> Tables("表A").Rows(i-1)("成绩") Then
mc=mc+1
End If
Tables("表A").Rows(i)("名次")=mc
Next
If Tables("表A").Filter > "" Then
Tables("表A").Filter +=" and 名次 is not null"
Else
Tables("表A").Filter ="名次 is not null"
End If
[此贴子已经被作者于2014-2-9 22:19:12编辑过]