CheckBoxes Stack up when Rows are hidden and unhidden

G

Guest

I have 8 check boxes in Excel on rows 1:4 and 6:9. I have other macros that
hide and unhide these rows together or separately. When all rows are hidden
and then unhidden, the checkboxes all stack up at the bottom on row 10.

Any property value I am overlooking with respect to the movements?

Thanks,
GoldenFoot
 
D

Dave Peterson

If you're using checkboxes from the Control Toolbox Toolbar, you can select them
all and then rightclick on the selection and:

Format Control|Properties tab|Check Move and size with cells

And make sure that each checkbox is completely in that cell/row.

If you're using checkboxes from the Forms toolbar, you won't be able to do
this. (I'd replace them with the control toolbox toolbar version.)
 
C

Carla

Dave, this is an old one, but it is assisting me with fixing my current
problem. The "move and size with cells" is gray, not an option to choose.
I'm sure that is why I am having a similar problem as the person below. Any
insight as to why I am not being allowed the option to check that box? The
other two are available to pick.

Thanks,
Carla
St. Petersburg, FL
 
D

Dave Peterson

There are two checkboxes that look very much alike.

The checkbox from the Forms toolbar does not allow this setting.

The checkbox from the control toolbox toolbar does allow it.

Are you sure you used the checkbox that you really wanted to use???
 
C

Carla

YOU ARE WONDERFUL! That is exactly it. I just searched help on check box
and it explained the one from the forms menu, so that's what I used. I will
change all of them out immediately!

Thank you!
Carla
St. Petersburg, FL
 
C

Carla

I need some more assistance. I did a test check box from the control
toolbox. I can't get it to do the check mark, it stays in some sort of
"edit" mode (or something). Any thoughts?

Thank you,
Carla
St. Petersburg, FL
 
G

Gord Dibben

On the Control Toolbox Toolbar at upper left you will see an Icon looks like a
T-square and a triangle.

Click on that to get out of "design mode".


Gord Dibben MS Excel MVP

I need some more assistance. I did a test check box from the control
toolbox. I can't get it to do the check mark, it stays in some sort of
"edit" mode (or something). Any thoughts?

Thank you,
Carla
St. Petersburg, FL
 
C

Carla

Thank you your assistance has now led me to my next question. Previously, I
was able to link the forms checkbox to the cell in which it resided and was
able to create an if statement based on whether it was checked (true) or not
(false). How do I do that sort of thing with a control checkbox?

Thank you,
Carla
 
D

Dave Peterson

You have to be in design mode.
Right click on the checkbox
Select Properties
Type the address in the LinkedCell property box.
Get out of design mode to test.

I like to give those cells a custom number format:
;;;
(3 semicolons)

That'll hide the value, but I can still see it in the formula bar with that cell
selected.
Thank you your assistance has now led me to my next question. Previously, I
was able to link the forms checkbox to the cell in which it resided and was
able to create an if statement based on whether it was checked (true) or not
(false). How do I do that sort of thing with a control checkbox?

Thank you,
Carla
 
C

Carla

Now, all is working perfectly. I am finally trying to make the actual check
box bigger, it's so tiny. When I adjust the height and width (in properties)
it only makes the area around the checkbox bigger.

P.S. as for the custom number format, I had never heard that before. What I
have always do when I don't want something seen, I change the font to white.

Thank you,
Carla
 
D

Dave Peterson

You can change the zoom factor so everything looks bigger, but that's about it.
 
C

Carla

If I insert or delete a row the "link" stays accurate with the changing row
number, so that works okay. I thought it was all good, but I have an issue.
I tried both copy/paste and cut/paste of a line that has a checkbox in it and
the checkbox didn't go with. What do I need to do to make the boxes follow
the cells they are linked to when they move and then change the row reference
in the link field?

P.S. I have "move but don't size with cells" checked.

Thank you,
Carla
 
D

Dave Peterson

I'm betting that the checkbox was not completely within the row before you
copied that row. I'd double check the positioning and then try the copy|paste
once more.

And you have to assign the linked cell to the new row yourself. The pasted
checkbox will still point back to the original linkedcell.


If I insert or delete a row the "link" stays accurate with the changing row
number, so that works okay. I thought it was all good, but I have an issue.
I tried both copy/paste and cut/paste of a line that has a checkbox in it and
the checkbox didn't go with. What do I need to do to make the boxes follow
the cells they are linked to when they move and then change the row reference
in the link field?

P.S. I have "move but don't size with cells" checked.

Thank you,
Carla
 
M

MWL

I'm trying to do the same thing in Excel 2002 but there is no option "Move
and size with cells" (unless I'm looking in the wrong place!).

I've created the check boxes from selecting them from the Control Toolbox
Toolbar.

Can this be done in Excel 2002?
 
M

MWL

A bit more clarity surrounding my problem.

I'm using Excel 2002 and I've got a number of check boxes which are
currently hidden in rows 16:19.

How can you automatically unhide them when another check box (which isn't
hidden) is selected?

I've tried the following code but it objects when it gets to
"ActiveSheet.Shapes("CheckBox12").Select":

Private Sub CheckBox1_Click()

Rows("15:20").Select
Range("A20").Activate
Selection.EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox12").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox13").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox14").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox15").Select
Selection.Visible = True

End Sub
 
D

Dave Peterson

Go into design mode.
Rightclick on the checkbox and select Format Control
You'll see it on the properties tab.
I'm trying to do the same thing in Excel 2002 but there is no option "Move
and size with cells" (unless I'm looking in the wrong place!).

I've created the check boxes from selecting them from the Control Toolbox
Toolbar.

Can this be done in Excel 2002?
 
D

Dave Peterson

Check your other post in the other newsgroup.

There's no reason to multipost.
A bit more clarity surrounding my problem.

I'm using Excel 2002 and I've got a number of check boxes which are
currently hidden in rows 16:19.

How can you automatically unhide them when another check box (which isn't
hidden) is selected?

I've tried the following code but it objects when it gets to
"ActiveSheet.Shapes("CheckBox12").Select":

Private Sub CheckBox1_Click()

Rows("15:20").Select
Range("A20").Activate
Selection.EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox12").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox13").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox14").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox15").Select
Selection.Visible = True

End Sub
 
M

MWL

Hi Dave,
Thanks for the info - I was looking in the wrong place!
I still have a problem though.

I've got a number of check boxes which are currently hidden in rows 16:19.

How can you automatically unhide them when another check box (which isn't
hidden) is selected?

I've tried the following code but I get an error which the debug points to
"ActiveSheet.Shapes("CheckBox12").Select":

Private Sub CheckBox1_Click()

Rows("15:20").Select
Range("A20").Activate
Selection.EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox12").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox13").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox14").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox15").Select
Selection.Visible = True

End Sub

Do you know what the problem is?
 
M

MWL

Hi Dave,
I can now unhide the check boxes but I now want to differentiate between
selecting and deselecting the original check box.

e.g. If the original check box is selected, I want the hidden check
boxes/rows to appear. If the original check box is de-selected, I want the
rows/check boxes to be hidden again.

Can this be done?
 
D

Dave Peterson

if me.checkbox1.value = true then
me.checkbox2.visible = true
else
me.checkbox2.visible = false
end if

(or something like that.)
Hi Dave,
I can now unhide the check boxes but I now want to differentiate between
selecting and deselecting the original check box.

e.g. If the original check box is selected, I want the hidden check
boxes/rows to appear. If the original check box is de-selected, I want the
rows/check boxes to be hidden again.

Can this be done?
 

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