参考代码
dim t as table = tables("表B")For Each sfz As String In t.DataTable.GetValues("第一列") Dim sum As Double = 0 For Each je As String In t.DataTable.GetValues("第三列", "第一列 = '" & sfz & "'") sum += val(je) Next msgbox(sfz & " " & sum)Next