Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
select From dropdown and return another dropdown menu RE4379 Excel Discussion (Misc queries) 2 March 11th 10 03:09 PM
Dropdown box display only data dependent on another dropdown box? Chris Excel Worksheet Functions 8 August 5th 08 05:01 PM
Dropdown List within a dropdown Henn9660 Excel Worksheet Functions 1 April 10th 08 07:42 PM
populating a dropdown based on choice from a previous dropdown Conor[_3_] Excel Programming 2 March 9th 06 07:15 PM
offer dropdown options based on another dropdown Conor Excel Discussion (Misc queries) 2 January 13th 06 04:28 PM


All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"