Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default after click a button(commandbutton), getting the button name


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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default after click a button(commandbutton), getting the button name

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 ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default after click a button(commandbutton), getting the button name



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 ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default after click a button(commandbutton), getting the button name

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" wrote in message
...


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
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
How Can I Click an un-name IE button via VBA angsoka Excel Programming 3 July 24th 06 03:56 AM
Create floating button based on button click in menu ExcelMonkey Excel Programming 2 October 12th 05 06:43 PM
On Button Click(Help!) jpizzle[_2_] Excel Programming 1 June 3rd 05 11:32 AM
VBA button click need help. Need LEN help. Nigel Cummins Excel Programming 4 July 11th 03 08:52 PM
VBA button click need help. Need LEN help. Nigel Cummins Excel Programming 0 July 11th 03 09:53 AM


All times are GMT +1. The time now is 02:04 PM.

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

About Us

"It's about Microsoft Excel"