Dim pr As DataRow For Each dr1 As DataRow In DataTables("个人年度汇总").DataRows If dr1.IsNull("编号") Then dr1("单位") = Nothing Else pr = DataTables("报酬明细").Find("编号 = '" & dr1("编号") & "'", "日期 Desc") If pr IsNot Nothing Then dr1("单位") = pr("单位") Else dr1("单位") = Nothing End If End If Next