Hiding Combo Boxes

C

charlie1234

Is it possible for me to create a macro so that when I click a button, a
combo box is hidden?

I'm using Excel 2007 and Vista Home Premium if that helps

Thanks
 
D

Dave Peterson

It'll depend on what kind of button and what kind of combobox.

It could be as simple as:

Option Explicit
Private Sub CommandButton1_Click()
With Me.ComboBox1
.Visible = Not .Visible
End With
End Sub

This actually toggles the visibility.

If you just want to hide it, use this line:

.Visible = false
 
Top