PDA

Click to See Complete Forum and Search --> : Public Sub not working


VB4fun
Nov 30th, 2005, 02:48 PM
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?

Sub ColorMe (opt as OptionButton)
If opt.value = True then
opt.caption= "chosen"
Else
opt.caption = "not"
End if


Private Sub optNumber1_Change()
ColorMe optNumber1
End Sub

dglienna
Nov 30th, 2005, 02:49 PM
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

VB4fun
Nov 30th, 2005, 02:54 PM
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