Thread: [Solved] ComboBox Variable AND list
View Single Post
 
Old 08-16-2020, 04:44 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Your code is filling the values which show in the list. It isn't setting the default value because you haven't asked it to.
You set the default by populating the value after the list is applied
Code:
Private Sub UserForm_Initialize()
Dim myPrefixes() As String
myPrefixes = Split(" |Mr. |Ms. |Dr.", "|")
Prefix1.List = myPrefixes
Prefix1 = "Mr. "
End Sub
It appears you are somewhat inconsistent with your spaces. Is there meant to be a space after Dr.?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote