Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Copy vb module in all excel sheets

I create a module in vb for excel but this module works within only a one
sheet. I want to make this module as default so that, whenever i open any new
workbook or any previously saved woorkbook, this vb module loads
automatically on that workbook. And i would use this module according to my
need. I dont wants to copy/paste the module every time i open any workbook.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Copy vb module in all excel sheets

Under your Programs, MicrosoftOffice, there is a folder entitled "XLStart".
In this folder you need a file named personal.xls If it is already there
then it is being loaded automatically each time you load Excel -- you are not
seeing it because it has been "hidden" and should remain hidden.
From within your current excel session - switch to the VBE (Alt-F11)
In the Project window you should see the file personal.xls

Select it's standard code window and put your macro (paste) into it.
Make appropriate changes to your code such as using a reference to the
Activesheet, instead of any specifically named sheet, etc,,,,, then
Save the File.

Ext Completely out of Excel -- And then Load it afresh/Again.

You and even Customize your toolbar to have an icon tied directly to
Run your "MySpecialMacro" on demand.

If you do not have a personal.xls file in your XLstart folder - create one
from a new workbook in excel, saving it the the XLStart folder then go back
up to my earlier situation where you find that it exists and proceed. After
creating and before saving the personal.xls - select Format, Sheets, Hide <<
to hide it on loading...

HTH

Jim May

, do nothing << because--
Sounds like you

"sohraaz" wrote:

I create a module in vb for excel but this module works within only a one
sheet. I want to make this module as default so that, whenever i open any new
workbook or any previously saved woorkbook, this vb module loads
automatically on that workbook. And i would use this module according to my
need. I dont wants to copy/paste the module every time i open any workbook.

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
Copy Excel sheets ksr Excel Discussion (Misc queries) 1 December 14th 05 03:26 PM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
How do I copy a new module to 200 workbooks with a macro? Patrick Young Excel Worksheet Functions 1 September 3rd 05 04:35 PM
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? Daniel Excel Worksheet Functions 1 July 6th 05 09:57 PM
how do I copy excel sheets with headers BJ Excel Worksheet Functions 1 February 15th 05 04:24 AM


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