Results 1 to 3 of 3

Thread: Public Sub not working

  1. #1

    Thread Starter
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342

    Public Sub not working

    I have a series of option buttons on a worksheet. I would like to run them through a routine when a value is changed...but it is not working....help?
    VB Code:
    1. Sub ColorMe (opt as OptionButton)
    2. If opt.value = True then
    3. opt.caption= "chosen"
    4. Else
    5. opt.caption = "not"
    6. End if
    7.  
    8.  
    9. Private Sub optNumber1_Change()
    10. ColorMe optNumber1
    11. End Sub
    Talk does not cook rice.
    -Chinese Proverb

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Public Sub not working

    Step thru the code and check the value of the option button. I don't know if true and false are correct. In VB6, there is VBChecked, VBUnchecked, and VBGreyed

  3. #3

    Thread Starter
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342

    Re: Public Sub not working

    good point, but, actually it is not even getting that far,

    I am getting a type mismatch, or object error, when it gets to the

    ColorMe optNumber1

    statement...

    I have tried numerous different ways....and still no luck
    Talk does not cook rice.
    -Chinese Proverb

Posting Permissions

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



Click Here to Expand Forum to Full Width