Thread: dropdown issue
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
sunilpatel sunilpatel is offline
external usenet poster
 
Posts: 57
Default dropdown issue


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
"Patrick Molloy" wrote in message
...
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


"Leith Ross" wrote in message
...

sunilpatel;389250 Wrote:
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


Hello Sunil,

I used the code below in both Excel 2000 and 2003 with no problems. It
is basically the same as yours. Try it out. If it doesn't work then
there is problem somewhere else.

Sub combodrop()
With ActiveSheet.ComboBox1
Visible = True
Clear
AddItem "Test 1"
AddItem "Test 2"
AddItem "Test 3"
DropDown
Visible = False
End With
End Sub

Sincerely,
Leith Ross


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.thecodecage.com/forumz/member.php?userid=75
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=108818