#1   Report Post  
GWB Direct
 
Posts: n/a
Default Drop Down box

I have a drop down box with the first cell in the list I left blank. I woulod
like to set up a button that would reset the drop down button to a blank.
What would the code be.
Thank You
--
Gary Baker
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

It would depend on what you used to create that dropdown--and where you'd place
that code would depend on the type of button you used.

If you used Data|validation, then...
worksheets("sheet1").range("a1").clearcontents
or
worksheets("sheet1").range("a1").value = ""

If you used a dropdown from the Forms toolbar, then...
Worksheets("sheet1").DropDowns("drop down 1").Value = 0
or
Worksheets("sheet1").DropDowns("drop down 1").ListIndex = 0

If you used a combobox from the control toolbox toolbar, then...
Worksheets("sheet1").ComboBox1.Value = ""
or
Worksheets("sheet1").ComboBox1.ListIndex = -1


GWB Direct wrote:

I have a drop down box with the first cell in the list I left blank. I woulod
like to set up a button that would reset the drop down button to a blank.
What would the code be.
Thank You
--
Gary Baker


--

Dave Peterson
  #3   Report Post  
GWB Direct
 
Posts: n/a
Default

Thanks Dave. As always you have been a big help. I used the forms toobar to
create the button and the combo drop down box. I'll try to use your code.
--
Gary Baker


"Dave Peterson" wrote:

It would depend on what you used to create that dropdown--and where you'd place
that code would depend on the type of button you used.

If you used Data|validation, then...
worksheets("sheet1").range("a1").clearcontents
or
worksheets("sheet1").range("a1").value = ""

If you used a dropdown from the Forms toolbar, then...
Worksheets("sheet1").DropDowns("drop down 1").Value = 0
or
Worksheets("sheet1").DropDowns("drop down 1").ListIndex = 0

If you used a combobox from the control toolbox toolbar, then...
Worksheets("sheet1").ComboBox1.Value = ""
or
Worksheets("sheet1").ComboBox1.ListIndex = -1


GWB Direct wrote:

I have a drop down box with the first cell in the list I left blank. I woulod
like to set up a button that would reset the drop down button to a blank.
What would the code be.
Thank You
--
Gary Baker


--

Dave Peterson

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
can you make a drop down list in a drop down list? Sburlingham Excel Discussion (Misc queries) 18 October 12th 09 07:58 AM
formulas for drop down menus Char Excel Discussion (Misc queries) 0 July 18th 05 07:29 PM
How do I set up a drop down menu within a drop down menu? Rob Excel Discussion (Misc queries) 1 April 12th 05 06:02 PM
automatic color change in cells using a drop down list kennethwt Excel Worksheet Functions 1 January 21st 05 06:37 PM
Filling drop down box Nick Excel Discussion (Misc queries) 0 November 25th 04 07:49 PM


All times are GMT +1. The time now is 10:25 AM.

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

About Us

"It's about Microsoft Excel"