
Option Explicit
Sub abc()
Dim a, i, j, t, m, d(1)
a = [a1].CurrentRegion.Value
ReDim b(1 To UBound(a) * UBound(a, 2), 1 To 2)
For i = 0 To UBound(d)
Set d(i) = CreateObject("scripting.dictionary")
Next
For i = 1 To UBound(a)
For j = 2 To UBound(a, 2)
If Len(a(i, j)) Then d(0)(a(i, 1)) = d(0)(a(i, 1)) & "," & a(i, j)
Next
Next
For Each i In d(0).keys
t = Split(d(0)(i), ",")
For j = 1 To UBound(t)
d(1)(t(j)) = 1
Next
For Each j In d(1).keys
m = m + 1
b(m, 1) = i: b(m, 2) = j
Next
d(1).RemoveAll
Next
[a1].Offset(, UBound(a, 2) + 1).Resize(m, 2) = b
End Sub