Try this:
![]()
Private Sub UserForm_Initialize() Dim i As Long Range("A1:A10").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal For i = 1 To 10 If Cells(i, 1) = "" Then UserForm1.Controls.Item(i - 1).Visible = False Else UserForm1.Controls.Item(i - 1).Visible = True UserForm1.Controls.Item(i - 1).Caption = Cells(i, 1).Value End If Next End Sub
Bookmarks