View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Returning active control name on multipage

Ryan,
'This works with a command button on a userform, it does not work with a label...
Private Sub CommandButton1_Click()
MsgBox Me.ActiveControl.Name
End Sub

'This passes the label name to the called procedure...
Private Sub LabelOne_Click()
Call ThisIsATest("LabelOne")
End Sub

Sub ThisIsATest(strName As String)
MsgBox strName
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Hokievandal"

wrote in message
When i click a lablel, i want to pass the label name onto a procedure but I
can't figure out how to recognize the active control's name (is a label the
active control if it has been clicked?). Here's the code after the label has
been clicked that does not return any value (just an error).

Me.Multipage.SelectedItem.ActiveControl.Name
Thanks,
Ryan