ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to incoporate new macros into existing spreadsheet? (https://www.excelbanter.com/excel-programming/422920-how-incoporate-new-macros-into-existing-spreadsheet.html)

salgud

How to incoporate new macros into existing spreadsheet?
 
This issue is not about writing code, more about what/how to place the code
once it's running properly. I do a lot of work on spreadsheets that are
already in use. I debug, or add features, or update, etc. So I copy a
spreadsheet that is out on the LAN for multiple user access, and then make
changes. If they're amall changes to a single macro, I just copy and paste
that particular macro into the "working" workbook. But what about when I
make extensive changes? Now I have the "working" spreadsheet on the LAN and
one with extensive changes to it on my machine. What is the safest way to
get all the new macros into the "working" sheet? Export/Import? Copy and
Paste? Copy the data sheets into the one with the updated macros? Seems to
me there could ba a "best practice". Or not.
Thanks in advance.

Dave Peterson

How to incoporate new macros into existing spreadsheet?
 
If the code is the same for each of these type of workbooks, then I think the
better choice is to separate the code from the data.

Create an addin that builds a toolbar/modifies a menu (or adds stuff to the
ribbon/QAT) to give the users a way to run the code.

If the macros are a set of useful utilities for any old workbook, then I'd
suggest the same thing.

But if the code is only used for that single workbook (exactly one, no
cheating!), then I'd put the code in that workbook.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

In xl2007, those toolbars and menu modifications will show up under the addins.

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

salgud wrote:

This issue is not about writing code, more about what/how to place the code
once it's running properly. I do a lot of work on spreadsheets that are
already in use. I debug, or add features, or update, etc. So I copy a
spreadsheet that is out on the LAN for multiple user access, and then make
changes. If they're amall changes to a single macro, I just copy and paste
that particular macro into the "working" workbook. But what about when I
make extensive changes? Now I have the "working" spreadsheet on the LAN and
one with extensive changes to it on my machine. What is the safest way to
get all the new macros into the "working" sheet? Export/Import? Copy and
Paste? Copy the data sheets into the one with the updated macros? Seems to
me there could ba a "best practice". Or not.
Thanks in advance.


--

Dave Peterson


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

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