Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I've writtten a macro under VBA and associate it to a button (Display, toolbar, form). Is it possible to be connected with this button in my vba code to modify its caption for instance ![]() YES ??? Great !! How ??? Thanks -- LeBob ------------------------------------------------------------------------ LeBob's Profile: http://www.excelforum.com/member.php...o&userid=31185 View this thread: http://www.excelforum.com/showthread...hreadid=508563 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the macro associated, you can do
Sub Btn_Click() Dim btn as Button set btn = Activesheet.Buttons(Application.Caller) If lcase(btn.Caption) = "no" then btn.Caption = "Yes" elseif lcase(btn.Caption) = "yes" then btn.Caption = "No" end if End Sub -- Regards, Tom Ogilvy "LeBob" wrote in message ... Hi, I've writtten a macro under VBA and associate it to a button (Display, toolbar, form). Is it possible to be connected with this button in my vba code to modify its caption for instance ![]() YES ??? Great !! How ??? Thanks -- LeBob ------------------------------------------------------------------------ LeBob's Profile: http://www.excelforum.com/member.php...o&userid=31185 View this thread: http://www.excelforum.com/showthread...hreadid=508563 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With ActiveSheet.DrawingObjects(Application.Caller)
..Text = "Clicked me!" End With Tim "LeBob" wrote in message ... Hi, I've writtten a macro under VBA and associate it to a button (Display, toolbar, form). Is it possible to be connected with this button in my vba code to modify its caption for instance ![]() YES ??? Great !! How ??? Thanks -- LeBob ------------------------------------------------------------------------ LeBob's Profile: http://www.excelforum.com/member.php...o&userid=31185 View this thread: http://www.excelforum.com/showthread...hreadid=508563 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I will try that right now !!! :) thanks everboby -- LeBob ------------------------------------------------------------------------ LeBob's Profile: http://www.excelforum.com/member.php...o&userid=31185 View this thread: http://www.excelforum.com/showthread...hreadid=508563 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi LeBob, Tom and Tim,
the coding of buttons has been a very confused part of my thinking. (Tom, I'm sure is very aware of this, he has corrected me in the not too distant past). After seeing this thread I'm now amazed at just how easy it is to code for buttons. How on earth did I managed to become so confused in the past? A big Thank You to all of you for helping me improve my VBA by revealing such simple and very useful button code. Ken Johnson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use Macro To Change Which Macro Assigned To Command Button | Excel Discussion (Misc queries) | |||
Creating a macro which presses a button containing a recorded macro | Excel Programming | |||
Can't select macro button after other button is pressed | Excel Programming | |||
Pause macro, add form button to sheet, continue macro when button clicked! | Excel Programming | |||
How to end macro on inital active worksheet containing macro button that was clicked | Excel Programming |