Refer to a an activex control status from a macro

jgoulart

Board Regular
Joined
Feb 16, 2002
Messages
62
I have a activex radio button that is named ship on a sheet that is named "invoice". I am trying to write a macro that will make a decision on what to do based on the state of that radio button. I don't know the correct synatx to call it. I have tried code like:

if sheets("invoice").ship = true then
(which didn't work)
or
if ship = true then
(which didn't work either)

Can someone give me a hand here?

Thanks,

John
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try the following:

If Worksheets("invoice").OptionButton1.Value = True Then MsgBox "it worked"

Change the name optionbutton1 to the name of your button, if you are sure it is named ship. Make sure that the name is ship and not just the caption.
 
Upvote 0

Forum statistics

Threads
1,214,381
Messages
6,119,192
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top