Thanks..what do you mean by the loop?
Thanks..what do you mean by the loop?
Check the below code for details to know where to add the suggested code...
Private Sub UserForm_Initialize() Dim rRng As Range, r As Range, rSortCr As String Set rRng = Sheet2.Range("a2:a5567") rSortCr = UCase(ActiveCell.Value) For Each r In rRng If InStr(UCase(r), rSortCr) Then Me.ListBox1.AddItem r.Value Next r If Me.ListBox1.ListCount = 1 Then Me.ListBox1.ListIndex = 0 Selection.Value = Me.ListBox1.Value End If End Sub
If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
Mark your thread as Solved
If the suggestion helps you, then Click *below to Add Reputation
Thanks that works - how do I unload the userform after it's chosen the word for me?
Just close it by clicking the X mark.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks