Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing commandbars to a procedure Doug Glancy Excel Programming 4 April 12th 06 01:07 AM
Passing a Function name as a procedure argument [email protected] Excel Programming 9 November 7th 05 02:55 PM
Passing Userform as an argument to a procedure Howard Kaikow Excel Programming 12 October 24th 03 03:24 PM
Passing properties to a procedure Matt McQueen[_2_] Excel Programming 1 July 30th 03 04:44 PM
Passing a Password to a VBA Procedure Orlando Magalhães Filho Excel Programming 0 July 9th 03 05:41 AM


All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"