Dim D As Object, y As Byte
Private Sub UserForm_Initialize()
Set D = CreateObject("Scripting.Dictionary")
For Each c In [Tc]: D(c.Value) = "": Next
ComboBox1.AddItem ""
ComboBox1.List = D.keys
ComboBox1.ListIndex = -1
End Sub
Private Sub ComboBox1_Change()
Dim x, y, z
ComboBox2.Visible = True
ComboBox2.AddItem ""
x = ActiveCell.Row() - 1
z = ActiveCell.Column()
y = Cells(x, z).End(xlDown).Row - 1
ComboBox2.List = Range("C" & x & ":C" & y).Value
ComboBox2.ListIndex = -1
End Sub
Private Sub ComboBox2_Change()
y = ComboBox2.ListIndex
ActiveCell.Resize(y, 1) = ComboBox1
ActiveCell.Resize(y, 1).Interior.ColorIndex = [Tc].Find(ComboBox1).Interior.ColorIndex
Unload Me
End Sub