Dim Book As New XLS.Book(路径1) Dim Sheet As XLS.Sheet = Book.Sheets(0) For Each dr3 As DataRow In DataTables("表A").Select("编码 is not null ") For n As Integer = 0 To Sheet.Rows.Count -1 If sheet(n,1).VALUE = dr3("编码") Then dr3("单价")= sheet(n,2).VALUE Exit For End If Next Next