|
楼主 |
发表于 2022-1-26 03:11
|
显示全部楼层
使用这个VBA,数据可以匹配一部分。DN开头的数据不能匹配。不懂是什么原因?各位大神帮忙看看什么问题!
如下:Sub aaa()
Dim i As Integer, j As Integer
Application.ScreenUpdating = False
'arr = Sheet2.Range("a1").CurrentRegion
With Sheets("sheet2")
'With Application.Sheets("Sheet2")
For i = 1 To [C65536].End(3).Row()
For j = 1 To [A65536].End(3).Row()
If Sheets("Sheet2").Cells(j, 1) = Cells(i, 3) Then
Cells(i, 6) = Sheets("Sheet2").Cells(j, 2)
Cells(i, 7) = Sheets("Sheet2").Cells(j, 3)
Exit For
Else
'Cells(i, 4) = ""
End If
Next
Next
End With
Application.ScreenUpdating = True
End Sub
|
|