Refer to a an activex control status from a macro
VBA Telemetry pings you when your VBA projects fail
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Refer to a an activex control status from a macro

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    John G
    Posts
    62
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com