how to use the object(optionbutton) as the function parameter?

C

cyberarmao

Function myFunction(myObject As object)
myObject.Caption = "ok"
.....
End Function

Private Sub OptionButton2_Click()
...
myFunction(ActiveSheet.OptionButton2)
...
End Sub

at the row2 , I find myObject is True, not ActiveSheet.OptionButton2.
Pls help me to modify the codes, thank you ^_^
 
C

Chip Pearson

Remove the parentheses when you call myFunction. I.e., change
myFunction(ActiveSheet.OptionButton2)
to
myFunction ActiveSheet.OptionButton2


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



message
news:[email protected]...
 
Top