ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   run macros automatically (https://www.excelbanter.com/excel-discussion-misc-queries/23940-run-macros-automatically.html)

saunak

run macros automatically
 
i have got around 10 macros in a excel spreadsheet. i want all of them to run
when i open the file. or there should be a button which will runs all the
macros whenever the user wants.

Neil

You can do it either way really,

First create a new macro, that runs all the ten macros that are in your
workbook.

If you want this macro to run whenever the sheet is opened, save it with the
name 'Auto_Exec' and it will run automatically when you open the book.

If you want to execute the macro on a button press, you can call it any name
you wish.
Next you will need to create a new button, so go to the 'View' menu, select
'Toolbars', then the 'Form' toolbar. From the toolbar now displayed, click on
the 'button' icon and create a new button on your sheet.
You will see a dialog sking you which macro you want to link this button to,
just select your macro that you created above, and everything should work
just fine.

HTH

Neil
www.nwarwick.co.uk

"saunak" wrote:

i have got around 10 macros in a excel spreadsheet. i want all of them to run
when i open the file. or there should be a button which will runs all the
macros whenever the user wants.


Bob Phillips

Call it Auto_Open, not Auto_Exec.

--
HTH

Bob Phillips

"Neil" wrote in message
...
You can do it either way really,

First create a new macro, that runs all the ten macros that are in your
workbook.

If you want this macro to run whenever the sheet is opened, save it with

the
name 'Auto_Exec' and it will run automatically when you open the book.

If you want to execute the macro on a button press, you can call it any

name
you wish.
Next you will need to create a new button, so go to the 'View' menu,

select
'Toolbars', then the 'Form' toolbar. From the toolbar now displayed, click

on
the 'button' icon and create a new button on your sheet.
You will see a dialog sking you which macro you want to link this button

to,
just select your macro that you created above, and everything should work
just fine.

HTH

Neil
www.nwarwick.co.uk

"saunak" wrote:

i have got around 10 macros in a excel spreadsheet. i want all of them

to run
when i open the file. or there should be a button which will runs all

the
macros whenever the user wants.




Neil

Oops, slipped into Access mode there, sorry if I caused any confusion!

"Bob Phillips" wrote:

Call it Auto_Open, not Auto_Exec.

--
HTH

Bob Phillips

"Neil" wrote in message
...
You can do it either way really,

First create a new macro, that runs all the ten macros that are in your
workbook.

If you want this macro to run whenever the sheet is opened, save it with

the
name 'Auto_Exec' and it will run automatically when you open the book.

If you want to execute the macro on a button press, you can call it any

name
you wish.
Next you will need to create a new button, so go to the 'View' menu,

select
'Toolbars', then the 'Form' toolbar. From the toolbar now displayed, click

on
the 'button' icon and create a new button on your sheet.
You will see a dialog sking you which macro you want to link this button

to,
just select your macro that you created above, and everything should work
just fine.

HTH

Neil
www.nwarwick.co.uk

"saunak" wrote:

i have got around 10 macros in a excel spreadsheet. i want all of them

to run
when i open the file. or there should be a button which will runs all

the
macros whenever the user wants.






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

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