Disappearing text

waggy30

New Member
Joined
Mar 2, 2002
Messages
46
On a UserForm I have two listboxes. the values in the second list box changes depending what is selected in the first listbox.
My problem is that the controlsource of the first list box (which the second list box depends on) seems to disappear immediately after the user has selected a value from it.
Even worse, when i return to the worksheet and attempt to enter a value that was in the rowsource of the first list box, that disappears as well. Any other value stays, just not those in its rowsource.
This is extremely annoying, and i've got no idea what the problem is.

My code for the second list box is:

Private Sub ListBox2_AfterUpdate()
If Range("MonthChoice") = "January" Then
ComboBox2.RowSource = "Jan"
ElseIf Range("MonthChoice") = "February" Then
ComboBox2.RowSource = "Feb"
ElseIf Range("MonthChoice") = "March" Then
ComboBox2.RowSource = "Mar"
ElseIf Range("MonthChoice") = "April" Then
ComboBox2.RowSource = "April"
ElseIf Range("MonthChoice") = "May" Then
ComboBox2.RowSource = "May"
ElseIf Range("MonthChoice") = "June" Then
ComboBox2.RowSource = "Jun"
ElseIf Range("MonthChoice") = "July" Then
ComboBox2.RowSource = "Jul"
ElseIf Range("MonthChoice") = "August" Then
ComboBox2.RowSource = "Aug"
ElseIf Range("MonthChoice") = "September" Then
ComboBox2.RowSource = "Sep"
ElseIf Range("MonthChoice") = "October" Then
ComboBox2.RowSource = "Oct"
ElseIf Range("MonthChoice") = "November" Then
ComboBox2.RowSource = "Nov"
ElseIf Range("MonthChoice") = "December" Then
ComboBox2.RowSource = "Dec"
End If
End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top