dropdown issue

  • Thread starter Thread starter sunilpatel
  • Start date Start date
S

sunilpatel

Sorry, as I have asked this question before, but can no one help me?
Having tried everything i can think of, i'm realy frustrated now.

In my code i use .dropdown (dot dropdown) , but then i wish the dropdown
list to 'close' once an item in the list has been selected.
This behaves as expected if combobox is activated by a mouse click, but if
..dropdown is used the dropdown list does not close.

I realy need a work around or something as my code relies heavily on this
process.

Please help - using excel 2000

Sub combodrop()
ActiveSheet.ComboBox1.Visible = True
ActiveSheet.ComboBox1.AddItem "TEST"
ActiveSheet.ComboBox1.DropDown
ActiveSheet.ComboBox1.Visible = False
End Sub

Sunil
 
dropdown is for the user to select an item, but that clearly isn't required.
You don't say clearly what it is you intend

Sub combodrop()
With ActiveSheet.ComboBox1
.Visible = True
.AddItem "hello"
.ListIndex = .ListCount - 1
.Visible = False
End With

End Sub
 
Hi. you must have the . before each method/property if you use WITH

Sub combodrop()
With ActiveSheet.ComboBox1
.Visible = True
.Clear
.AddItem "Test 1"
.AddItem "Test 2"
.AddItem "Test 3"
.DropDown
.Visible = False
End With
End Sub
 
Thankyou. but when i run this code, the combobox dissapears as expected, but
the dropdown list (test 1 ....test 3) remains on screen !!!
Maybe i should try on another computer hey?

Sunil
 
drop the
..Dropdown
line

sunilpatel said:
Thankyou. but when i run this code, the combobox dissapears as expected,
but the dropdown list (test 1 ....test 3) remains on screen !!!
Maybe i should try on another computer hey?

Sunil
 
but that is what i want. i want the list to be dropped down when a certain
action is taken.

Sunil
 
Back
Top