How do I hide the outline of a Forms Group Box?

G

Guest

I am using a couple of groups of option buttons but would prefer not to show
the actual box around the group. Is there a way to hide the outline?
 
N

Norman Jones

Hi MadTodd,

You can use VBA code to do this:

Sub HideGroupBox()
Dim Sh As Worksheet

Set Sh = ActiveSheet
Sh.GroupBoxes("Group Box 1").Visible = False

End Sub


Change Group Box 1 to the name of your groupbox.
 
N

Norman Jones

Hi MaddTodd,

And to hide all the groupboxes, try:

Sub HideAllGroupBoxes()
Dim Sh As Worksheet
Dim gBox As GroupBox
Set Sh = ActiveSheet

For Each gBox In Sh.GroupBoxes
gBox.Visible = False
Next gBox

End Sub
 
D

Dave Peterson

And if there aren't too many...

ActiveSheet.GroupBoxes.Visible = False

(I'm not sure how many is too many, though.)
 
N

Norman Jones

Hi Dave,
ActiveSheet.GroupBoxes.Visible = False

The difference is that the OP is paying *me* by the word!

(I'm not sure how many is too many, though.)

Are you aware of such a limit and, if so, do you know if it is a limit on
the number of objects which can be handled in a pass, or a limitation on the
number of objects?
 
D

Dave Peterson

I am aware that a limit exists when working with shapes/objects.

But I'm not sure what that limit is (or if it's a hard limit--or if it depends
on what's in use (memory??)).

I do know that the single line fails when there are lots (and quite a few people
have lots of shapes in worksheets based on posts around here).

I've never seen your looping code fail.

I'm not sure I understand the second portion. Since it's a one liner, I'm
guessing that it's based on the number of objects, since there's only one pass
(did that make sense???).
 
G

Guest

Thanks for the help folks. I know just enough VBA to be dangerous at a
cocktail party, but nothing ventured nothing gained!
 

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