Hiding Combo Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top