Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
dropdown issue
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
dropdown issue
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 "sunilpatel" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
dropdown issue
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
dropdown issue
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
dropdown issue
drop the ..Dropdown line "sunilpatel" wrote in message ... 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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
dropdown issue
but that is what i want. i want the list to be dropped down when a certain action is taken. Sunil "Patrick Molloy" wrote in message ... drop the .Dropdown line "sunilpatel" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
select From dropdown and return another dropdown menu | Excel Discussion (Misc queries) | |||
Dropdown box display only data dependent on another dropdown box? | Excel Worksheet Functions | |||
Dropdown List within a dropdown | Excel Worksheet Functions | |||
populating a dropdown based on choice from a previous dropdown | Excel Programming | |||
offer dropdown options based on another dropdown | Excel Discussion (Misc queries) |