Referring to Controls in Module

Hi Experts,

I'm having an issue that I think is pretty simple (and fundamental) but can't find the best way around it...

Basically I have 2 option buttons on a worksheet CyesOPT & CnoOPT

When CyesOPT is true there are a number of controls that I'd like to make visible. Vice versa these controls need to NOT be visible when CnoOPT is true.

The controls are:

voiceOUTopt.Visible = False
voiceDIALopt.Visible = False
recordYESopt.Visible = False
recordNOopt.Visible = False

I've set up a named range and it references CyesOPT so that when it's 'true' it = 1
That range is called 'TELEcontact'

I've then added a module to the Click of CyesOPT that does the following:

Sub CCTyesOPT_Click()
If Range("TELEcontact").Value = 1 Then
MsgBox ("yes, the value is true!") ' this works fine!

'When I get to the following:
voiceOUTopt.Visible = False
voiceDIALopt.Visible = False
recordYESopt.Visible = False
recordNOopt.Visible = False
'I get the error 424 Object Required

Do I need to declare the objects?
THe worksheet is called Technology and I've tried to indicate what sheet the controls are on but the error persists.

I think this is probably something very simple and will be fundamental to my model. Any help appreciated.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieVBA ExpertCommented:
You need a worksheet reference.

How did you create the controls?

Was it through the Forms or ActiveX control toolbar?

Also, what's the codename of the worksheet(s) they are on?
martywalAuthor Commented:
Thanks imnorie!


I used the insert FormControls in Excel 2010
NorieVBA ExpertCommented:
Can you attach a sample workbook?

It doesn't really need to have any data, just the checkboxes.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

martywalAuthor Commented:
Hope this helps...
Basically when the 'Is contact centre telephony required = YES
The controls in the grey (and the rows) need to be visible/unhidden
Thanks again for your help
Try this:
With Worksheets("ORF - Technology").Shapes
    !TECHvoiceDIALopt.Visible = False
    !TELErecordYESopt.Visible = False
    !TELErecordNOopt.Visible = False
    !TelePurpCOMPopt.Visible = False
    !TelePurpQAopt.Visible = False
End With

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
martywalAuthor Commented:
That worked a treat!
Thanks really appreciate your help on this!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.