Command Button to clear dropdowns

Brando

Enthusiastic Novice
Local time
Today, 03:15
Joined
Apr 4, 2006
Messages
100
I want a command button in an Excel form to clear dropdown fields on the form. Can anyone tell me why this simple VB code will not work?:


Private Sub CommandButton2_Click()

DropDown4 = ""
DropDown7 = "Choose from List"

End Sub
 
You have not qualified your objects so Excel does not know what you are talking about.
Assuming you have renamed your combobox to "DropDown4" then you would need to use :-
Code:
me.dropdown4.clear
and
Code:
me.dropdown7.clear
me.dropdown7.additem "Choose From List"
although this will cause you problems later.
 

Users who are viewing this thread

Back
Top Bottom