Last line selected in ComboBox

  • Thread starter Thread starter donwb
  • Start date Start date
D

donwb

Win XP, Excel 2003

On my form there's a Combo Box with shows the first only of 7 optional
selections in the initial mode, and all 7 in the drop down mode.
When one (say the second entry) is selected, it does something and the
form's dismissed.
How can I arrange matters so that when the form is recalled,
it shows the last selected entry in the initial mode, rather than the first.
donwb
 
Assuming you meant UserForm when you said "form"... place the ComboBox's
ListIndex property value in the control's Click event in a "global" location
(an cell on the worksheet if you want the index number to survive when the
workbook is closed; a variable Dim'med in the (General)(Declaration) section
of the UserForm's code window if you only need to keep it available while
the UserForm is open) and assign this value back to the ListIndex when you
Initialize the UserForm.
 
Thanks Rick

Rick Rothstein said:
Assuming you meant UserForm when you said "form"... place the ComboBox's
ListIndex property value in the control's Click event in a "global"
location (an cell on the worksheet if you want the index number to survive
when the workbook is closed; a variable Dim'med in the
(General)(Declaration) section of the UserForm's code window if you only
need to keep it available while the UserForm is open) and assign this
value back to the ListIndex when you Initialize the UserForm.
 
Back
Top