Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing a Label object to another procedure
Hi,
on my form I have to set captions of several labels when they are clicked. I want to do that in a stand-alone procedure but I can't figure our how to pass the label which was clicked from the Label1_Click procedure to the SetTheLabelsCaptionHere procedure. I don't want to do it with a function: The labels caption should be set in the SetTheLabelsCaptionHere procedure. Thank You Robin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing a Label object to another procedure
Robin,
Private Sub Label1_Click() MsgBox LabelClicked(Label1) End Sub Private Sub Label2_Click() MsgBox LabelClicked(Label2) End Sub Private Function LabelClicked(argLabel As MSForms.Label) As String LabelClicked = argLabel.Caption End Function NickHK "derobin" wrote in message oups.com... Hi, on my form I have to set captions of several labels when they are clicked. I want to do that in a stand-alone procedure but I can't figure our how to pass the label which was clicked from the Label1_Click procedure to the SetTheLabelsCaptionHere procedure. I don't want to do it with a function: The labels caption should be set in the SetTheLabelsCaptionHere procedure. Thank You Robin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
passing commandbars to a procedure | Excel Programming | |||
Passing a Function name as a procedure argument | Excel Programming | |||
Passing Userform as an argument to a procedure | Excel Programming | |||
Passing properties to a procedure | Excel Programming | |||
Passing a Password to a VBA Procedure | Excel Programming |