Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bonzio
 
Posts: n/a
Default How to auto activate macro when file opened

I have created a macro in the visual basic editor of my excel file, but I
don't know how to auto activate the macro whenever this file is opened or
when "Shift" &":" buttons are pressed. Can someone teach me how to make this
happen.
Thank you.

Bonzio
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default How to auto activate macro when file opened

If you want the macro to run only when the file is opened, you can put the
code in a Workbook_Open event macro.
You can accomplish the same thing by putting the macro in a regular module
and naming the macro Auto_Open.
However, if you want the macro to run when the file is opened AND also when
you press a key combination, then you need the above Auto_Open macro in a
regular module.
To make the macro run from a key combination, go back to your
spreadsheet on the screen. Click on Tools - Macro - Macros and you will see
a list of all macros in all open workbooks. Select This Workbook to see
only those macros in the active workbook. Find the Auto_Open macro. Click
once on that macro, then click on Options. There you will see "Ctrl" and a
blank box. Hold down the Shift key and press the letter key of your choice,
say K. Now when you hold down both the Ctrl and Shift keys and press K, the
macro will run.
Please post back if you need more. HTH Otto
"bonzio" wrote in message
...
I have created a macro in the visual basic editor of my excel file, but I
don't know how to auto activate the macro whenever this file is opened or
when "Shift" &":" buttons are pressed. Can someone teach me how to make
this
happen.
Thank you.

Bonzio



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bonzio
 
Posts: n/a
Default How to auto activate macro when file opened

Thank you for your info, and now I have accomplished what I wanted for my
programming file.

Bonzio

"Otto Moehrbach" wrote:

If you want the macro to run only when the file is opened, you can put the
code in a Workbook_Open event macro.
You can accomplish the same thing by putting the macro in a regular module
and naming the macro Auto_Open.
However, if you want the macro to run when the file is opened AND also when
you press a key combination, then you need the above Auto_Open macro in a
regular module.
To make the macro run from a key combination, go back to your
spreadsheet on the screen. Click on Tools - Macro - Macros and you will see
a list of all macros in all open workbooks. Select This Workbook to see
only those macros in the active workbook. Find the Auto_Open macro. Click
once on that macro, then click on Options. There you will see "Ctrl" and a
blank box. Hold down the Shift key and press the letter key of your choice,
say K. Now when you hold down both the Ctrl and Shift keys and press K, the
macro will run.
Please post back if you need more. HTH Otto
"bonzio" wrote in message
...
I have created a macro in the visual basic editor of my excel file, but I
don't know how to auto activate the macro whenever this file is opened or
when "Shift" &":" buttons are pressed. Can someone teach me how to make
this
happen.
Thank you.

Bonzio




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default How to auto activate macro when file opened

You're welcome and thanks for the feedback. Otto
"bonzio" wrote in message
...
Thank you for your info, and now I have accomplished what I wanted for my
programming file.

Bonzio

"Otto Moehrbach" wrote:

If you want the macro to run only when the file is opened, you can put
the
code in a Workbook_Open event macro.
You can accomplish the same thing by putting the macro in a regular
module
and naming the macro Auto_Open.
However, if you want the macro to run when the file is opened AND also
when
you press a key combination, then you need the above Auto_Open macro in a
regular module.
To make the macro run from a key combination, go back to your
spreadsheet on the screen. Click on Tools - Macro - Macros and you will
see
a list of all macros in all open workbooks. Select This Workbook to see
only those macros in the active workbook. Find the Auto_Open macro.
Click
once on that macro, then click on Options. There you will see "Ctrl" and
a
blank box. Hold down the Shift key and press the letter key of your
choice,
say K. Now when you hold down both the Ctrl and Shift keys and press K,
the
macro will run.
Please post back if you need more. HTH Otto
"bonzio" wrote in message
...
I have created a macro in the visual basic editor of my excel file, but
I
don't know how to auto activate the macro whenever this file is opened
or
when "Shift" &":" buttons are pressed. Can someone teach me how to
make
this
happen.
Thank you.

Bonzio






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
Weird File Open/Save As Behavior [email protected] Excel Discussion (Misc queries) 0 December 9th 05 02:26 AM
macro save a workbook whilst increasing file no shrek Excel Worksheet Functions 0 November 10th 05 02:40 PM
Open an Excel file with a date as today in a macro Perry Excel Discussion (Misc queries) 4 November 10th 05 09:57 AM
file opened twice on network stevenmorrison Excel Discussion (Misc queries) 1 October 25th 05 03:44 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM


All times are GMT +1. The time now is 06:13 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"