Dim t As Table = Tables("表B") Dim max As Integer = 0 Dim idx As Integer = 0 Dim cs As new List(Of String) For Each c As Col In t.cols If c.Name.StartsWith("第") Then Dim count As Integer = t.Compute("count(" & c.name & ")", c.name & " is not null") If count > max Then max = count idx = cs.count End If cs.add(c.name) End If Next msgbox(idx) For i As Integer = 0 To cs.count-1 If i <> idx Then For Each r As Row In t.rows r(cs(i)) = r(cs(idx)) - val(r("第十列"))*(idx-i) Next End If Next
|