View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default active control box name on worksheet

In a standard module, declare a public string variable (one line at the top)
Public strCtlName as String

In the Sheet module...
Private Sub ToggleMonth1_Click()
strCtlName = Me.ToggleMonth1.Name
'other code
End Sub
--
Jim Cone
Portland, Oregon USA
Review of Special Sort add-in...
http://www.contextures.com/excel-sort-addin.html






"pjbur2005 via OfficeKB.com" <u18722@uwe
wrote in message
Hi
i have tried to find the answer to this,
I ahve used a control box command button and want to determine its name from
code so i can use this elsewhere. i know application.caller does not work

Private Sub ToggleMonth1_Click()
Dim CtrlName As String
With Worksheets("DP + SDS")
ctrlname = ? 'help it should be toggleMonth1
End With
End Sub
--
Message posted via OfficeKB.com