PC Review


Reply
Thread Tools Rate Thread

after click a button(commandbutton), getting the button name

 
 
x taol
Guest
Posts: n/a
 
      15th Feb 2008

Dim btn As MSForms.CommandButton

A sheet has a commandbutton.
what i want to, I click the button, getting the button name.
msgbox "this button name is " & xxx






*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
RyanH
Guest
Posts: n/a
 
      15th Feb 2008
You just need to use the caption property of the command button.

MsgBox "this button name is " & btn.Caption

"x taol" wrote:

>
> Dim btn As MSForms.CommandButton
>
> A sheet has a commandbutton.
> what i want to, I click the button, getting the button name.
> msgbox "this button name is " & xxx
>
>
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
>

 
Reply With Quote
 
x taol
Guest
Posts: n/a
 
      15th Feb 2008


RyanH!
Surely, I already know it.
I want to know caption of the command button, when I click the button
the moment
namely,,,,,
1.click the button
2.It seems the name of the button in the message box.

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Ker_01
Guest
Posts: n/a
 
      15th Feb 2008
If you need the whole sub, this should give you a starting point. Be sure to
change the CommandButton1 if you are using this with a button of a different
name.

Private Sub CommandButton1_Click()
MsgBox CommandButton1.Caption
MsgBox CommandButton1.Name
End Sub

"x taol" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> RyanH!
> Surely, I already know it.
> I want to know caption of the command button, when I click the button
> the moment
> namely,,,,,
> 1.click the button
> 2.It seems the name of the button in the message box.
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button.Click event doesn't fire when clicking button in formView.InsertItemTemplate Andy B. Microsoft ASP .NET 0 25th Nov 2009 03:27 PM
How to fire both event button click and textchanged when button is click and text is changed Amy Microsoft ASP .NET 0 1st Jun 2006 03:33 PM
hitting enter button while in textbox calls correct button's click event TS Microsoft ASP .NET 5 29th Nov 2005 01:54 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge Microsoft ASP .NET 2 26th May 2004 12:45 AM
instead of right click as save on each file i want to have a select button to choose from and then a download button to get them all at once Jasonc Windows XP Customization 5 25th Dec 2003 06:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:36 AM.