I'm trying to display a listbox in a UserForm from a separate sheet called "Fields". The problem is, the list will not display. It shows as a drop down arrow next to the cell, but not in the userform like I'm wanting.
Private Sub UserForm_Activate2() On Error Resume Next Me.ListBox2.Clear For Each element In gFieldsListArr Me.ListBox2.AddItem element Next element UserForm_initialize2 End Sub Private Sub UserForm_initialize2() For Each element In Split(gCellCurrVal2, ",") For ii = 0 To ListBox2.ListCount - 1 If element = Me.ListBox2.List(ii) Then Me.ListBox2.Selected(ii) = True End If Next ii Next element End Sub
https://stackoverflow.com/questions/66147012/listbox-not-displaying-in-userform February 11, 2021 at 08:09AM
没有评论:
发表评论