Renaming Module Made Macros Not Run

Shiremaid

Board Regular
Joined
Jun 18, 2013
Messages
73
I have it fixed for the moment but am concerned about it possibly happening again because I don't know why it happened in the first place.

This is what happened:

In Excel 2007 I have a spreadsheet with a bunch of macros in it. (The spreadsheet is a list of Materials on Sheet1 which users can select items from to add to a form on Sheet 2).

In an effort to make editing the macros easier, I put all like macros together in separate modules which I then named. Not hard because I recorded and edited like macros at the same time so most of them were already properly grouped, I just re-named the module.

The next time a user opened the sheet, several macros were suddenly not working.

When I looked I found that for some reason the macro names had changed on only some of the macros to include the module name.

For instance:
In one module called A_Sort_304 I have macros:
Open_304
Close_304
Angle_304
Bar_304
Channel_304
Pipe_Tube_304
Plate_304
Sheet_304
Other_304

Bar_304 no longer worked. All of the others are perfectly fine and appear normally in my macro list but Bar_304 now shows as
A_Sort_304.Bar_304
Bar_304 was not the only one that was moved into this module from another one. Nor is it the only one moved from a particular module to this one.

So my questions are:

How did that happen?
Why did it only happen to 13 out of 82 macros in the workbook?
How can I make it not happen next time I make updates?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You appear to be using names for the modules that are pretty similar to the subs in the modules, that's not really a good idea.

By the way, just curious, do all the modules have basically the same set of subs.
 
Upvote 0
Yes, there are nearly 2000 materials that the users want sorted into much smaller subsets so there are about 8 similar sets of macros.

I will look at using different names for the modules then as it's work in progress and hopefully that will help prevent further changes.

Thanks

You appear to be using names for the modules that are pretty similar to the subs in the modules, that's not really a good idea.

By the way, just curious, do all the modules have basically the same set of subs.
 
Upvote 0
If these subs are similar perhaps you don't need so many.

How much do they differ?

For example, how does the Open_X sub from Module_X differ from Open_Y from Module_Y?
 
Upvote 0
Each of those subs filters the list of materials for the foremen.
I have learned some about If Thens (mostly from this forum) since I first set up the sheet, so it's a work in progress and I am hoping I can get the total number of macros down. I just don't want to have to worry about the buttons breaking down every time I change something.



If these subs are similar perhaps you don't need so many.

How much do they differ?

For example, how does the Open_X sub from Module_X differ from Open_Y from Module_Y?
 
Upvote 0

Forum statistics

Threads
1,216,471
Messages
6,130,822
Members
449,595
Latest member
jhester2010

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