Sub Distribue()
Dim T, Tcode, DC%, i%, L%, C%
[B10:Z1000].ClearContents
Application.ScreenUpdating = False
DC = Cells(4, Columns.Count).End(xlToLeft).Column
ReDim Tcode(1 To Application.Max([4:4]))
T = [A1].CurrentRegion
For i = 2 To UBound(T, 2)
If T(4, i) <> "" Then Tcode(T(4, i)) = 1
Next i
C = 2
For i = 1 To UBound(Tcode)
If Tcode(i) <> "" Then Cells(11, C) = i: C = C + 1
Next i
For i = 2 To UBound(T, 2)
If T(4, i) <> "" Then
C = Application.Match(T(4, i), [11:11], 0)
L = 1 + Cells(65000, C).End(xlUp).Row
Cells(L, C) = T(2, i)
End If
Next i
C = 2
While Cells(11, C) <> ""
Cells(10, C) = Application.CountIf(Range(Cells(12, C), Cells(1000, C)), ">0")
C = C + 1
Wend
End Sub