Two Macros in Only One Button

Arun C M

New Member
Joined
Dec 4, 2008
Messages
31
Hi,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I have created a Macro File that will be used by all, that will contain many operations and it integrates with other applications also; so I have prepared Operation Manual in PDF.
When person needs a help for any operation then that “Operation Manual” should open.
To this I have created two buttons attached with Macro (One for Open One for Close).
Are there any possibilities I can create one Hyperlink or Macro in Only One Button.
Process: If user clicks first time Help file as to Open If user clicks second time Help file as to close.
<o:p></o:p>
Thanks in advance
<o:p></o:p>
Arun C M
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
you could link your code to a cell and based on the state of that cell, conditionally run the code
 
Upvote 0
In the Control Toolbox there is a toggle button - this remembers what state it's in, so you don't need a separate cell to do that. You can call different code depending on whether the button is True or False, and can also change the caption on the button:

Code:
Private Sub ToggleButton1_Click()

If ToggleButton1.Value = True Then
    MsgBox "Your help file code here"
    ToggleButton1.Caption = "Close help file"
Else
    MsgBox "Your close code here"
    ToggleButton1.Caption = "Open help file"
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,203,099
Messages
6,053,527
Members
444,669
Latest member
Renarian

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top