Sub TongHopVT()
Dim Sh As Worksheet, Rng As Range, sRng As Range, Cls As Range
Dim Cot As Byte
Set Sh = Sheets("DinhMuc")
Set Rng = Sh.Range(Sh.[A4], Sh.[A5].End(xlDown))
Rng.Offset(, 2).Value = "" '<=|'
For Each Cls In Range([f2], Cells(Dong, "F").End(xlUp))
1 'Tìm Mã Hàng Tai Trang DinhMuc & Gán Só Luong:'
Set sRng = Rng.Find(Cls.Value, , xlFormulas, xlWhole)
If sRng Is Nothing Then
Exit For
Else
sRng.Offset(, 2).Value = Cls.Offset(, 2).Value
End If
Next Cls
2 ' Tìm Só Luong Tai DinhMuc & Gán:'
Set Rng = Sh.Range(Sh.[D3], Sh.[iV3].End(xlToLeft))
For Each Cls In Range([B2], [B2].End(xlDown))
Set sRng = Rng.Find(Cls.Value)
If Not sRng Is Nothing Then
Cot = sRng.Column + 1
Cls.Offset(, 1).Value = Sh.Cells(Dong, Cot).Value
End If
Next Cls
End Sub