Với dữ liệu đẹp như sheet Ton_LiFo có thể dùng sub
Sub TonLiFo()
Dim aTon(), arr(), res(), dic As Object, sh As Worksheet
Dim srTon&, sRow&, i&, r&, lR&, ik&, sl#, key$
Set dic = CreateObject("Scripting.Dictionary")
Set sh = Sheets("Ton_LIFO")
lR = sh.Range("G" &...