Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default VBA code shared between .XLS files

I have lots of worksheet files that use the same VBA code. Currently I copy
the code from one file to the next. However, if there is an error in the VBA
code, I have to go to ALL the files and update it, which is a royal pain.
Combining all the files into a single file is not practical. How can I have
a single copy of the VBA code that is used by all the files?
--
John
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 225
Default VBA code shared between .XLS files

Create a worksheet with the macros you want.
Choose Window, Hide and then save it to
C:\Program Files\Microsoft Office\Office\Xlstart (assuming you used the
default location when you installed Office).

To add/modify macros in personal.xls, choose Window, Unhide to unhide
personal.xls. After you finish storing your macros, choose Window, Hide to
hide personal.xls again.


"BitTwiddler" wrote:

I have lots of worksheet files that use the same VBA code. Currently I copy
the code from one file to the next. However, if there is an error in the VBA
code, I have to go to ALL the files and update it, which is a royal pain.
Combining all the files into a single file is not practical. How can I have
a single copy of the VBA code that is used by all the files?
--
John

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default VBA code shared between .XLS files


Write an XLA add-in. Then when code needs updating, you just update
the one XLA file. See http://www.cpearson.com/Excel/CreateAddIn.aspx
for the basics for writing an XLA. They're quite simple.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Fri, 20 Mar 2009 07:51:00 -0700, BitTwiddler
wrote:

I have lots of worksheet files that use the same VBA code. Currently I copy
the code from one file to the next. However, if there is an error in the VBA
code, I have to go to ALL the files and update it, which is a royal pain.
Combining all the files into a single file is not practical. How can I have
a single copy of the VBA code that is used by all the files?

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
Shared Files in Excel Ben Kawaguchi Excel Discussion (Misc queries) 0 October 23rd 08 12:00 AM
PC name vs User name for shared files? Stonewall Rubberbow Excel Discussion (Misc queries) 1 June 4th 08 12:45 AM
sort in shared files peyman Excel Discussion (Misc queries) 0 October 23rd 07 09:59 PM
Shared files - read only on the fly Wanda Excel Discussion (Misc queries) 4 September 26th 07 04:20 PM
Shared files Judy Excel Worksheet Functions 0 September 12th 05 07:15 PM


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

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"