dropdown issue

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
 
P

Patrick Molloy

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
 
P

Patrick Molloy

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
 
S

sunilpatel

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
 
P

Patrick Molloy

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
 
S

sunilpatel

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

Sunil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top