littleme was telling us:
littleme nous racontait que :
> Hello again.
>
> Thank you for the excellent help last time I posted here.
>
> Have a new small problem. Have searched the forum but cant seem to
> find what I need. Im very new to allt his so...
>
> What I would like is: depending on what value is selected form
> combobox1, textbox (or label is possible) is populated with 1 of 3
> values.
You did not look very hard... This is one of the most common questions...
Here is one way of doing it (Based on a simple userform with only two
controls on it):
'_______________________________________
Private Sub ComboBox1_Change()
With Me.ComboBox1
Select Case .ListIndex
Case 0
Me.TextBox1.Text = "Nothing was was selected"
Case 1
Me.TextBox1.Text = """Choice 1"" was selected"
Case 2
Me.TextBox1.Text = """Choice 2"" was selected"
Case 3
Me.TextBox1.Text = """Choice 3"" was selected"
End Select
End With
End Sub
'_______________________________________
'_______________________________________
Private Sub UserForm_Initialize()
With Me.ComboBox1
.AddItem "Select"
.AddItem "Choice 1"
.AddItem "Choice 2"
.AddItem "Choice 3"
.ListIndex = 0
End With
End Sub
'_______________________________________
Of course, if you have more than a few items in the dropdown, you would use
an array and the .List() method to populate it.
--
Salut!
Jean-Guy Marcil - Word MVP
jmarcilREMOVE RemoveThis @CAPSsympatico.caTHISTOO
Word MVP site:
http://www.word.mvps.org