Private Sub UserForm_Initialize() Dim arr, d As Object, i% arr = Sheet5.Range("B2:B" & Sheet5.Range("B65536").End(3).Row) Set d = CreateObject("Scripting.Dictionary") For i = 2 To UBound(arr) If Not d.Exists(arr(i, 1)) Then d(arr(i, 1)) = "" End If Next ComboBox1.List = d.keys Sheet1.[B3].Resize(d.Count) = Application.Transpose(d.keys)
Sheet1.Activate
For i = ActiveSheet.Range("B65536").End(xlUp).Row To 3 Step -1 If i >= 3 Then Range("A" & i).Value = i - 2