Naming modules / macros?

nancyo

Active Member
Joined
Mar 25, 2002
Messages
255
I have a macro which was in an unnamed module in a file (i.e. module 4). I selected the module, F4, and typed in a name for the module.

When I went to tools/macro/macro to list all the macros, it listed the macro name twice
(i.e. NewTC.NewTC). Any idea why this would happen?

I had to go thru my spreadsheets and re-assign all the macro buttons. Am I missing something simple?

BTW, each module only has one macro in it.

Or is it just friday PM...
This message was edited by nancyo on 2002-05-03 13:20
 
OK - the more I think about this, I think that the reason I am getting the multiple names & filename is because I am using this macro in multiple files. These spreadsheets need to be available to at least 10 of my analysts, so I can't save in my personal.xls.

So, I can leave as is or change the module name back (which I will probably do, good idea klb).

The macro works fine (thanks again Nate!!), so if it isn't broke, don't fix it.
This message was edited by nancyo on 2002-05-07 05:59
This message was edited by nancyo on 2002-05-07 05:59
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
It's not becuase it's in multiple files, it's because there are two macros with the same name in the same workbook.

From the macro dialog box, highlight one of the macros, click 'edit.' This will take you to the macro in question. Change:

Code:
sub NewTC()

to 

sub NewTC_2()


If you have buttons, you may need to reassign them, but this will resolve the issue.
 
Upvote 0
Nate - OK, I did what you said to all my files which contained the two macros(the macros still worked after I reassigned the buttons!). I now it's what you originally suggested, but I'm trying to figure things out so I can learn some of this stuff (apparently, not very well...). Why would I get duplicate copies of the same macro without trying?
This message was edited by nancyo on 2002-05-07 09:54
 
Upvote 0
This is learning Nancy. It's probably just an oversight, you went to one module and pasted it and went to another and pasted it by accident, no big deal (e.g., virus or lack of xl knowledge). I do it every day, that's how I'm well aquainted with the ambiguity error. Glad to see you're giving an honest effort. :)
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top