Chào các Anh GPE
em muốn thêm kết quả trả về cột T & cột Y
thì sữa code như thế nào
em muốn thêm kết quả trả về cột T & cột Y
thì sữa code như thế nào
Mã:
Dim DK(), KQ()
Dim i As Long, Str As Range, j As Byte
Application.ScreenUpdating = False
For j = 2 To 30 Step[COLOR=#ff0000] [B]5[/B][/COLOR]
With Sheet1
DK = .Range(.Cells(6, j), .Cells(65000, j).End(xlUp)).Value
End With
ReDim KQ(1 To UBound(DK), 1 To 1)
For i = 1 To UBound(DK)
Set Str = Sheet2.[A:A].Find(DK(i, 1), , , xlWhole)
If Not Str Is Nothing And DK(i, 1) <> vbNullString Then
KQ(i, 1) = Str.Offset(, 2)
End If
Next
Sheet1.Cells(6, j + 2).Resize(i - 1, 1) = KQ
Set Str = Nothing

