Dim t As Table = Tables("表B")
Dim ls1 As new List(Of String)
Dim ls2 As new List(Of String)
For Each r As Row In t.rows
if r("第一列") > "" then ls1.add(r("第一列"))
if r("第二列") > "" then ls2.add(r("第二列"))
Next
For i As Integer = 0 To t.rows.count-1
Dim r As Row = t.rows(i)
If r("第一列") > "" andalso ls2.Contains(r("第一列")) = False Then
Dim nr As Row = t.addnew
nr("第二列") = r("第一列")
nr.DataRow.SetError("第二列", "缺失")
End If
Next
For i As Integer = 0 To t.rows.count-1
Dim r As Row = t.rows(i)
If r("第二列") > "" andalso ls1.Contains(r("第二列")) = False Then
Dim nr As Row = t.addnew
nr("第一列") = r("第二列")
nr.DataRow.SetError("第一列", "缺失")
End If
Next