[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 118
  • Last Modified:

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.

Cheers

Martywal
0
martywal
Asked:
martywal
  • 3
  • 2
1 Solution
 
NorieCommented:
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?
0
 
martywalAuthor Commented:
Thanks imnorie!
It's

sheet5(Technology)

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

It doesn't really need to have any data, just the checkboxes.
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
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
ControlTest.xlsm
0
 
IrogSintaCommented:
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

Ron
0
 
martywalAuthor Commented:
That worked a treat!
Thanks really appreciate your help on this!
Cheers
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now