vb做的表比对

Sub found()
Dim rgtem As Range
Dim rgfw As Range
Dim rg As Range
Set rgtem = Workbooks("二批管控计划汇总.xls").Sheets(1).Range("n2")
Set rgfw = Workbooks("中标结果行信息数据表_2012年第二批设备材料招标采购.xls").Sheets(1).Range("a:a")
Do
rgtem.Value = Workbooks("二批管控计划汇总.xls").Sheets(1).Range("c2").Offset(j, 0) * 100000 + Workbooks("二批管控计划汇总.xls").Sheets(1).Range("d2").Offset(j, 0)
Set rg = rgfw.Find(what:=rgtem.Value, lookat:=xlWhole)
If Not rg Is Nothing Then
    For i = 1 To 14
        rgtem.Offset(0, i).Value = rg.Offset(0, i)
           
    Next i


End If
j = j + 1
Set rgtem = rgtem.Offset(1, 0)
Loop While rgtem.Offset(0, -1).Value <> ""
End Sub

你可能感兴趣的:(vb)