For i As Integer = 0 To Book.Sheets.Count -1 Dim a As String = Book.Sheets(i).Name If a = ny Then Dim mg As New Merger mg.SourcePath = ProjectPath & "银行余额.xls" mg.Format = "excel" '指定格式 mg.SourceTableName = "" & ny &"$" '指定要合并的表 mg.DataTableName = "余额明细" '指定接收数据的表 mg.Merge() '开始合并 For Each dr As DataRow In DataTables("余额明细").DataRows If dr.IsNull("年月") Then dr("年月") = ny End If Next Return End If Next Messagebox.show("需导入的数据不存在!","提示")
|