ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Combo Box (https://www.excelbanter.com/excel-programming/372327-hide-combo-box.html)

Troubled User

Hide Combo Box
 
I need the syntax for hiding and showing a combo box in VB. I can get it to
hide using:

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = False

But when I try to use

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = True

It won't let me see it (Get VB error). I think this is because I need to
turn on the Design Mode. Does anyone know the syntax to do that / solve
this problem. Thank you.








Die_Another_Day

Hide Combo Box
 
Eliminate the select as you can't select a non-visible item:
ActiveSheet.Shapes("ComboBox3").Visible = True

Charles Chickering

Troubled User wrote:
I need the syntax for hiding and showing a combo box in VB. I can get it to
hide using:

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = False

But when I try to use

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = True

It won't let me see it (Get VB error). I think this is because I need to
turn on the Design Mode. Does anyone know the syntax to do that / solve
this problem. Thank you.



PCLIVE

Hide Combo Box
 
To add on to this, you can use one macro to do both functions.

If ActiveSheet.Shapes("ComboBox1").Visible = False _
Then
ActiveSheet.Shapes("ComboBox1").Visible = True
Else:
ActiveSheet.Shapes("ComboBox1").Visible = False

End If


"Die_Another_Day" wrote in message
oups.com...
Eliminate the select as you can't select a non-visible item:
ActiveSheet.Shapes("ComboBox3").Visible = True

Charles Chickering

Troubled User wrote:
I need the syntax for hiding and showing a combo box in VB. I can get it
to
hide using:

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = False

But when I try to use

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = True

It won't let me see it (Get VB error). I think this is because I need to
turn on the Design Mode. Does anyone know the syntax to do that / solve
this problem. Thank you.





Tom Ogilvy

Hide Combo Box
 
With ActiveSheet.Shapes("ComboBox1")
.Visible = Not .Visible
End with

--
Regards,
Tom Ogilvy

"PCLIVE" wrote in message
...
To add on to this, you can use one macro to do both functions.

If ActiveSheet.Shapes("ComboBox1").Visible = False _
Then
ActiveSheet.Shapes("ComboBox1").Visible = True
Else:
ActiveSheet.Shapes("ComboBox1").Visible = False

End If


"Die_Another_Day" wrote in message
oups.com...
Eliminate the select as you can't select a non-visible item:
ActiveSheet.Shapes("ComboBox3").Visible = True

Charles Chickering

Troubled User wrote:
I need the syntax for hiding and showing a combo box in VB. I can get
it to
hide using:

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = False

But when I try to use

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = True

It won't let me see it (Get VB error). I think this is because I need
to
turn on the Design Mode. Does anyone know the syntax to do that /
solve
this problem. Thank you.







teabag

Hide Combo Box
 
Just wanted to say that a short search through the threads has again saved me
hours of headache.
This was exactly what I was looking for, thank you all so much!

teabag


"Tom Ogilvy" wrote:

With ActiveSheet.Shapes("ComboBox1")
.Visible = Not .Visible
End with

--
Regards,
Tom Ogilvy

"PCLIVE" wrote in message
...
To add on to this, you can use one macro to do both functions.

If ActiveSheet.Shapes("ComboBox1").Visible = False _
Then
ActiveSheet.Shapes("ComboBox1").Visible = True
Else:
ActiveSheet.Shapes("ComboBox1").Visible = False

End If


"Die_Another_Day" wrote in message
oups.com...
Eliminate the select as you can't select a non-visible item:
ActiveSheet.Shapes("ComboBox3").Visible = True

Charles Chickering

Troubled User wrote:
I need the syntax for hiding and showing a combo box in VB. I can get
it to
hide using:

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = False

But when I try to use

ActiveSheet.Shapes("ComboBox3").Select
Selection.Visible = True

It won't let me see it (Get VB error). I think this is because I need
to
turn on the Design Mode. Does anyone know the syntax to do that /
solve
this problem. Thank you.








All times are GMT +1. The time now is 08:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com