Hide/show active x listbox

A

Angus Beaumont

I have an activex list box that I would like to hide or show from a
button on the worksheet. is this possible and if so what would the
code be to run the macro?

thanks
 
C

Claus Busch

Hi Angus,

Am Wed, 2 May 2012 01:41:39 -0700 (PDT) schrieb Angus Beaumont:
I have an activex list box that I would like to hide or show from a
button on the worksheet. is this possible and if so what would the
code be to run the macro?

try:
Private Sub CommandButton1_Click()
If ListBox1.Visible = True Then
CommandButton1.Caption = "Show Listbox"
ListBox1.Visible = False
Else
CommandButton1.Caption = "Hide Listbox"
ListBox1.Visible = True
End If
End Sub


Regards
Claus Busch
 
A

Angus Beaumont

Hi Angus,

Am Wed, 2 May 2012 01:41:39 -0700 (PDT) schrieb Angus Beaumont:


try:
Private Sub CommandButton1_Click()
If ListBox1.Visible = True Then
    CommandButton1.Caption = "Show Listbox"
    ListBox1.Visible = False
Else
    CommandButton1.Caption = "Hide Listbox"
    ListBox1.Visible = True
End If
End Sub

Regards
Claus Busch

Perfect, thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top