Hide/Unhide Form Control

Q

qwerty

I have a forms checkbox control on a worksheet. Control is title "cbLOC".
Based on the selection of a dropdown box, I want this control to show or not
show.

Right now I have created a text box slightly larger than the control and
superimposed over top of the checkbox.

The plan is to send the checkbox control to the foreground when it needs to
be available otherwise hide it in the background by sending it to the back.

Code at the moment is Sheets("Inputs").Shapes("cbLOC").ShapeRange.ZOrder
msoSendToBack

I get a runtime error 438. Do I need to force it into "Design Mode" and how
do I do that?

Is there any way to simply hide the control rather than covering it up?
 
B

Bob Phillips

This will toggle it

With Sheets("Inputs").Shapes("cbLOC")
.Visible = Not .Visible
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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