Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Toggle Event - 2 Commands on 1 Button

I'm looking for just the basic code that will allow 2 macros to execute
independently of each other when the button they're assigned to is actuated,
or toggled (for example...I use Essbase and I need to toggle it on and off
frequently, as it disallows me to format sheets while it's on). I'll be
using this for a variety of different "toggle" actions and just need the
basic code that accomplishes this, to sandwich the macros between. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Toggle Event - 2 Commands on 1 Button

I think this is what you wish to do (This is the code behind a button):

Private Sub CommandButton2_Click()
If CommandButton2.Caption = "Second Step" Then
CommandButton2.Caption = "First Step"
Call SecondStep
ElseIf CommandButton2.Caption = "First Step" Then
CommandButton2.Caption = "Second Step"
Call FirstStep
End If
End Sub


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
Command button to toggle worksheet event code on / off? Fred[_2_] Excel Discussion (Misc queries) 15 July 31st 07 11:50 AM
Sub() calling Sub()'s in the "worksheet event code€ť passing toggle CRayF Excel Programming 2 September 25th 05 03:48 AM
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
commands button pts Excel Programming 1 June 24th 05 08:05 AM
toggle button & event code Bob Umlas[_3_] Excel Programming 0 April 14th 05 08:22 PM


All times are GMT +1. The time now is 11:46 PM.

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"