Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / December 2005

Tip: Looking for answers? Try searching our database.

How to auto activate macro when file opened

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bonzio - 17 Dec 2005 03:34 GMT
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
Otto Moehrbach - 17 Dec 2005 12:50 GMT
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
>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
[quoted text clipped - 4 lines]
>
> Bonzio
bonzio - 17 Dec 2005 13:59 GMT
Thank you for your info, and now I have accomplished what I wanted for my
programming file.

Bonzio

> If you want the macro to run only when the file is opened, you can put the
> code in a Workbook_Open event macro.
[quoted text clipped - 20 lines]
> >
> > Bonzio
Otto Moehrbach - 17 Dec 2005 15:19 GMT
You're welcome and thanks for the feedback.  Otto
> Thank you for your info, and now I have accomplished what I wanted for my
> programming file.
[quoted text clipped - 36 lines]
>> >
>> > Bonzio
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.