```
Private Sub ComboBox4_Click()
Me.ListBox1.Clear
If UBound(UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value)(Me.ComboBox4.Value), 2) > 1 Then
Me.ListBox1.List = Application.Transpose(UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value)(Me.ComboBox4.Value))
Else
With Me.ListBox1
.AddItem UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value)(Me.ComboBox4.Value)(1, 1)
.List(0, 1) = UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value)(Me.ComboBox4.Value)(2, 1)
.List(0, 2) = UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value)(Me.ComboBox4.Value)(3, 1)
End With
End If
End Sub
Private Sub UserForm_Initialize()
Dim Ary As Variant, x As Variant
Dim i As Long
Set UfDic = CreateObject("scripting.dictionary")
With Sheets("Master")
Ary = .Range("A2:G" & .Range("A" & Rows.Count).End(xlUp).Row).Value2
End With
For i = 1 To UBound(Ary)
If Not UfDic.Exists(Ary(i, 1)) Then UfDic.Add Ary(i, 1), CreateObject("scripting.dictionary")
If Not UfDic(Ary(i, 1)).Exists(Ary(i, 2)) Then UfDic(Ary(i, 1)).Add Ary(i, 2), CreateObject("scripting.dictionary")
If Not UfDic(Ary(i, 1))(Ary(i, 2)).Exists(Ary(i, 3)) Then UfDic(Ary(i, 1))(Ary(i, 2)).Add Ary(i, 3), CreateObject("scripting.dictionary")
If Not UfDic(Ary(i, 1))(Ary(i, 2))(Ary(i, 3)).Exists(Ary(i, 4)) Then
UfDic(Ary(i, 1))(Ary(i, 2))(Ary(i, 3)).Add Ary(i, 4), Application.Transpose(Array(Ary(i, 5), Ary(i, 6), Ary(i, 7)))
Else
x = UfDic(Ary(i, 1))(Ary(i, 2))(Ary(i, 3))(Ary(i, 4))
ReDim Preserve x(1 To 3, 1 To UBound(x, 2) + 1)
x(1, UBound(x, 2)) = Ary(i, 5)
x(2, UBound(x, 2)) = Ary(i, 6)
x(3, UBound(x, 2)) = Ary(i, 7)
UfDic(Ary(i, 1))(Ary(i, 2))(Ary(i, 3))(Ary(i, 4)) = x
End If
Next i
Me.ComboBox1.List = UfDic.Keys
End Sub
```