ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macros is several worksheets (https://www.excelbanter.com/excel-discussion-misc-queries/203575-macros-several-worksheets.html)

Lisa

Macros is several worksheets
 
Hi all -

When I copy a worksheet, I need to be able to use the same macros for the
new sheet. The problem I am having is that when I go to the newly copied
sheet, and run the macro, it goes back to the previous sheet. Is there a way
to have the macro reference the new sheet?

JasonP CCTM LV[_2_]

Macros is several worksheets
 
Is this worksheet one that other people use and need to use the macros as well?

If not, then I would suggest saving the macros on your personal macro file,
which means they would be accessable only on that computer.

"Lisa" wrote:

Hi all -

When I copy a worksheet, I need to be able to use the same macros for the
new sheet. The problem I am having is that when I go to the newly copied
sheet, and run the macro, it goes back to the previous sheet. Is there a way
to have the macro reference the new sheet?


Lisa

Macros is several worksheets
 
yes, this worksheet will be used by other people.

"JasonP CCTM LV" wrote:

Is this worksheet one that other people use and need to use the macros as well?

If not, then I would suggest saving the macros on your personal macro file,
which means they would be accessable only on that computer.

"Lisa" wrote:

Hi all -

When I copy a worksheet, I need to be able to use the same macros for the
new sheet. The problem I am having is that when I go to the newly copied
sheet, and run the macro, it goes back to the previous sheet. Is there a way
to have the macro reference the new sheet?


Dave Peterson

Macros is several worksheets
 
I'd create a single addin that did the work. Then I'd either place that addin
in a common location (on a network drive that everyone can read) and let the
users install the addin.

If that's not possible (remote users--or users who are not always connected to
the network), then I'd distribute an addin with the instructions that it has to
be saved in the same folder on everyone's pc.

C:\WorkAddins\LisasUtils.xla

By using the same location, it'll make life much easier if workbooks are shared
between co-workers.

But by creating an addin, I'd have to give the users a way to execute those
macros.

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
or
http://spreadsheetpage.com/index.php...g_custom_menus

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

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

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




Lisa wrote:

Hi all -

When I copy a worksheet, I need to be able to use the same macros for the
new sheet. The problem I am having is that when I go to the newly copied
sheet, and run the macro, it goes back to the previous sheet. Is there a way
to have the macro reference the new sheet?


--

Dave Peterson


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

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