处理表B
Dim pdr As DataRow = Nothing
For Each dr As DataRow In DataTables("表B").Select("姓名 is not null", "_Sortkey")
If dr.IsNull("工资") Then
pdr = dr
Else
dr("第三列") = pdr("姓名")
End If
Next
查询表A
Dim pdr As DataRow = Nothing
For Each dr As DataRow In DataTables("表A").Select("姓名 is not null", "_Sortkey")
If dr("姓名") Like "第*" Then
pdr = dr
Else
Dim fdr As DataRow = DataTables("表B").Find("姓名 = '" & dr("姓名") & "' and 第三列 = '" & pdr("姓名") & "'")
If fdr IsNot Nothing
dr("第三列") = pdr("姓名")
dr("工资") = fdr("工资")
End If
End If
Next