For Each r1 As Row In Tables("表").Rows '遍历表的各行 If r1.IsNull("型号规格") =True Then '先判断型号1是否为空 Dim x As String=r1("型号规格") Dim r As DataRow= DataTables("水卫工程量").Find("型号规格 = '" & x & "'") '找出编号为03的产品 If r IsNot Nothing Then r1("根数1") = r("根数1") r1("规格1") = r("规格1") r1("根数2") = r("根数2") r1("规格2") = r("规格2") End If End If Next