```
Option Explicit
Dim UfDic As Object
Private Sub ComboBox1_Click()
Me.ComboBox2.Clear
Me.ComboBox3.Clear
Me.ComboBox4.Clear
Me.ComboBox2.List = UfDic(Me.ComboBox1.Value).Keys
End Sub
Private Sub ComboBox2_Click()
Me.ComboBox3.Clear
Me.ComboBox4.Clear
Me.ComboBox3.List = UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value).Keys
End Sub
Private Sub ComboBox3_Click()
Me.ComboBox4.Clear
Me.ComboBox4.List = UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value).Keys
End Sub
Private Sub ComboBox4_Change()
Me.ListBox1.Clear
Me.ListBox1.List = Application.Transpose(UfDic(Me.ComboBox1.Value)(Me.ComboBox2.Value)(Me.ComboBox3.Value)(Me.ComboBox4.Value))
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(Application.Index(Ary, i, Array(5, 6, 7))) '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
```