return .caption text of worksheet control

S

Susan

i've tried several ways to get this to work, but i can't. i'm
beginning to think you cannot get the .caption off the
control......... (when it's a toolbox control):

Private Sub OptionButton2_Click()
Initial_Sheet_Select ActiveSheet.OLEObjects _("OptionButton2")
End Sub


Public Sub Initial_Sheet_Select(OLEobj As OLEObject)
With OLEobj
sTab = .Caption
End With
wb.Sheets(sTab).Select
End Sub


any ideas?
thanks!
susan
 
T

Tom Ogilvy

Private Sub OptionButton2_Click()
Initial_Sheet_Select ActiveSheet.OLEObjects _
("OptionButton2")
End Sub


Public Sub Initial_Sheet_Select(OLEobj As OLEObject)
With OLEobj
sTab = .Object.Caption '<===
End With
wb.Sheets(sTab).Select
End Sub
 
S

Susan

THANK YOU THANK YOU THANK YOU!!!!
like an hour of agonizing & researching over a stupid period!!!
:)
susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top