It's got to be an obvious mistake, but I'm having trouble with the following code:
Private Sub cmdInventory_Click()
Dim selOpt As OptionButton
Dim studyName As String
Set selOpt = ActiveSheet.OptionButtons(Application.Caller)
If selOpt.Value = True Then
studyName = selOpt.Name
MsgBox studyName
End If
End Sub
Execution from the worksheet yields a:
"Run-time error '1004':
Unable to get the OptionButtons property of the Worksheet class"
Execution from the VBA editor yields a:
"Run-time error '1004':
Application-defined or object-defined error"
What syntax have I goofed??
The examples I have use the above syntax, but I can't seem to get them to go either...
Bookmarks