I have a userform where users enter in items that will become their drop-down menus. The form works great!
This is the code for that form:
Private Sub ClientsSubmit_Click()
Dim Address As String
Dim Items() As String
Dim Count As Integer
Items = Split(Me.TextBox2.Value, vbCrLf)
Count = UBound(Items) - LBound(Items) + 1
With ThisWorkbook.Sheets("Lists")
Address = .Range("Clients").Address
.Range("Clients").ClearContents
.Range(Address).Resize(Count, 1).Value = Application.Transpose(Items)
End With
Unload Me
Call AlphabetizeClients
MsgBox "Your repeat client list is now ready."
Exit Sub
End Sub
However, now I want to add a different form where users can edit this drop-down list. So if they later want to delete or add an item they can. So I need the userform textbox to populate with their current drop-down list (each item on a separate line). Then a user can edit that textbox, and then when they click submit it will be the same previous code so it will create their newly edited list.
This is my poor attempt:
Private Sub EditClient_Initialize()
With Me.EditClientbox
.MultiLine = True
.Value = Worksheets("Lists").Range("Clients")
End With
End Sub
But when I click on the form, there is just a blank textbox. I knew this code wouldn't work. It was my poor attempt.
I just need the form to already have their list in the textbox. And then they can modify that list any way they want, and then on submit, I will have the same code as before.
Any ideas on how to get the textbox to show the content found in that range, each item showing on a different line.
Bookmarks