Form Control Combobox to clear

osy25

New Member
Joined
Jan 15, 2025
Messages
4
Office Version
  1. 365
Hi,
Not a professional, just program for my self.
I have a combobox on a sheet without activeX. I would like to have a button to clear the selection. Using VBA i found that this combobox is refereed to DropDown... Under Button click i have
Sheet1.DropDown1.Clear

Unfortunately this code does not work.
How do i clear the selection via VBA?
Thank you!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi and welcome to MrExcel

- Mouse over your Combo Box and right-click
- Choose Format Control – to popup Format Control Dialog box
- Go to the Control tab.
- Type “E4” in the Cell link input box.
- Press OK

1736957784492.png


Then you delete the value in the cell, for example:
VBA Code:
Range("E4").clear

That way you delete the contents of the combobox.


🤗
 
Last edited:
Upvote 0
Thank you very much for the reply.
However my question concerns the text in the combobox itself, not the cell link.
 
Upvote 0
Try this. The following also clears the combobox text

Change AZ1 for a cell that you have available

VBA Code:
Sub Clear_Combo()
  Dim acell As Range
 
  Set acell = ActiveCell
  ActiveSheet.Shapes("DropDown1").Select
  With Range("AZ1")
    Selection.LinkedCell = .Address
    .Clear
    Selection.LinkedCell = ""
  End With
  acell.Activate
End Sub
 
Upvote 0
Is an inserted form control a shape?
Yes

The formControl combobox has very limited properties, I suggest you change it to an ActiveX combobox. Then you use:
VBA Code:
Sub ClearComboActiveX()
  ActiveSheet.ComboBox1.Value = ""
End Sub
 
Upvote 0
Another solution for DropDown. Can also be for a control without a linked cell.
VBA Code:
Sub ClearDD()
    Dim DD As DropDown
    
    Set DD = ActiveSheet.DropDowns("Drop Down 1") 'or ActiveSheet.DropDowns(1)
    
    DD.Value = 0
    
End Sub
Artik
 
Upvote 0

Forum statistics

Threads
1,226,112
Messages
6,189,036
Members
453,520
Latest member
packrat68

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top