• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Reset Drop Down List

Busymanjohn

Member
Hi guys, I have a couple of drop down lists ( Combo Boxes ) in a sheet in cells C16 and E16. I am looking for a code that will reset the drop down lists to <Select> which is the default choice in each list. The idea is to attach the code to Form Button for the users to click on. Any ideas?
 
Hey ,


In Onclick event of the button add the below code


ComboBox1.Value = "<Select>"

ComboBox2.Value = "<Select>"


Thanks,

Dinesh
 
Hey,


In the Form select the command button you have and right click on it and select view code . you would get the VBE window.. There add the code I have provided. Let me know if this is not clear...
 
Hi Dinesh ,,,, doesn't work, the button is not clickable, I checked in View Code and the Click option is selected, so not sure why the button won't click when I hover over it, any ideas?
 
Good day Busymanjohn


Can you go to developers tab/controls and click on Design mode it will then allow you to edit your button
 
Good evening Busymanjohn


Runtime error 424 means there is some thing not quite right with the VBA, can you post the code and maybe a VBA guru can help
 
Hi bob ,,, code is attached to a Command Button ,,,


ComboBox1.Value = "<Select>"

ComboBox2.Value = "<Select>"


as posted by Dinesh above. Any help would be appreciated.
 
Hi Busymanjohn,


Just passing by...and stop here looking at your post.


Can you please check the workbook from here?


https://hotfile.com/dl/171845453/7a593cf/Reset_to_select.xlsm.html


First combobox is filled with A, B, C and second combobox is filled with D,E,F


As of now, for first combobox I have selected A and for second combobox I have selected F


Now clicking on the command button both the combobox value would reset to "select".


Click the command button and check if this is what you are looking for.


@ bobhc and Dinesh121:


Sorry for putting my nose in between...:)


Regards,

Kaushik
 
Hey Kaushik,


No problem I was not able to figure out why the code is not working for Busymanjohn...


I am glad that you were able to help Busymanjohn.


@Busymanjohn : Please let us know if you still face problem


-Dinesh
 
Good day kaushik03


Sorry for putting my nose in between...no such thing, the more that help and show different solutions the better :)
 
Hi guys, this is fine for use with Active X Controls ,,,, I was using Form Control Combo Boxes and Button ( I have Vlookups working off the boxes ), however, I managed to find a piece of VBA that did the trick using Form Control buttons, but this code only works with one box, would like it to work with 2 boxes so I don't need two buttons ,,, the code is

ub Reset()

'' Reset Macro

Range("C16").Select

ActiveCell.FormulaR1C1 = ""

End Sub

The two combo boxes are in C16 and E16
 
Since you are using code anyway, is there some reason why we can't switch to using ActiveX controls?
 
Hi guys, I decided to change to Active X controls ,,,, was a little against using them as the file is for someone who has limited knowledge of Excel ,,,, but no reason why they can't extend their knowledge right. Thanks guys, appreciate the help as always.
 
Back
Top