ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating a button on Excel Toolbar (https://www.excelbanter.com/excel-programming/284062-creating-button-excel-toolbar.html)

Todd Huttenstine[_2_]

Creating a button on Excel Toolbar
 
Hey guys,

I need when a workbook is opened, for it to create a
button on the Excel toolbar that contains the following
code....

If MsgBox("Are you sure?", vbYesNo) = vbNo Then
Exit Sub
End If
Worksheets(1).Range("C5").Select
ActiveSheet.Paste
MsgBox "Data Pasted!", vbOKOnly


I need this button to be visible on ANY workbook opened
after this button is created.


Is this possible?

Thanx

Todd Huttenstine

Tom Ogilvy

Creating a button on Excel Toolbar
 
Create your macro and give it a name. Put it in a general module -
probably in Personal.xls would be good.

go to tools=customize and select the second tab (commands)

in the left window select macros and in the right window click and drag the
custom button to the toolbar where you want the button.

Right click on the button and select assign macro - optionally change the
icon if you want an icon displayed.

now you can close the customize dialog.

--
Regards,
Tom Ogilvy

"Todd Huttenstine" wrote in message
...
Hey guys,

I need when a workbook is opened, for it to create a
button on the Excel toolbar that contains the following
code....

If MsgBox("Are you sure?", vbYesNo) = vbNo Then
Exit Sub
End If
Worksheets(1).Range("C5").Select
ActiveSheet.Paste
MsgBox "Data Pasted!", vbOKOnly


I need this button to be visible on ANY workbook opened
after this button is created.


Is this possible?

Thanx

Todd Huttenstine




Todd Huttenstine[_2_]

Creating a button on Excel Toolbar
 
Thank you


-----Original Message-----
Create your macro and give it a name. Put it in a

general module -
probably in Personal.xls would be good.

go to tools=customize and select the second tab

(commands)

in the left window select macros and in the right window

click and drag the
custom button to the toolbar where you want the button.

Right click on the button and select assign macro -

optionally change the
icon if you want an icon displayed.

now you can close the customize dialog.

--
Regards,
Tom Ogilvy

"Todd Huttenstine"

wrote in message
...
Hey guys,

I need when a workbook is opened, for it to create a
button on the Excel toolbar that contains the following
code....

If MsgBox("Are you sure?", vbYesNo) = vbNo Then
Exit Sub
End If
Worksheets(1).Range("C5").Select
ActiveSheet.Paste
MsgBox "Data Pasted!", vbOKOnly


I need this button to be visible on ANY workbook opened
after this button is created.


Is this possible?

Thanx

Todd Huttenstine



.



All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com