Change macro Sub name vs Properties name?

ooptennoort

Board Regular
Joined
Mar 29, 2021
Messages
67
Office Version
  1. 365
Platform
  1. Windows
I was advised (internet somewhere) to change the name of my macro's to solve my issue that, somehow, the shortcuts assigned to my (public) macro's in my PERSONAL.XLSB stopped working.

Q1) Should I change the words after Sub or change the name in the properties window?

Q2) What effects do changing either have? Can anyone advise a best practice dealing with this 'duplicity' (for lack of a better word)?

Q3) Is there the a better way of solving my issue that, somehow, the shortcuts assigned to my (public) macro's in my PERSONAL.XLSB stopped working (this should be another thread, I realise)?
 
If you select File - Options - AddIns, does your workbook show in the list of disabled items?
No, none.

Don't know if this makes sense but it seems to usually (always?) happen with macro's that have 'a dot' in the Alt+F8 pane... see blue:
1670494397042.jpeg


This probably has something to do with my trying to rename macro's, but since different kinds of renaming of macro's seem to go around ;) I don't know what I'm doing (not a VBA expert).
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
That happens because you named the module and the macro the same. That is generally not a good idea.
 
Upvote 0
That happens because you named the module and the macro the same. That is generally not a good idea.
Ah, so here I see difference between the two (at least verbally). Which brings me to the start, i.e. to Q1 & Q2: which is best practice, changing only the module (through properties window, right?) or only the macro (through changing the words after 'Sub', right?) and how do I 'live' with the name discrepancy between the two? How do you experts go about this?
 
Upvote 0
All my modules have a prefix assigned to the name. I have no idea what you mean by "how do I live with the name discrepancy"? They should have different names.
 
Upvote 0
Solution
All my modules have a prefix assigned to the name. I have no idea what you mean by "how do I live with the name discrepancy"? They should have different names.
It is starting to dawn on me. I'm sorry. I now realise, which seems silly I now realise; I tried and now see I one can copy more than one macro in one module and a line appears. So this allows Grouping/Hierarchy of sorts. Thank you. Had not realised this.
 
Upvote 0

Forum statistics

Threads
1,223,749
Messages
6,174,288
Members
452,554
Latest member
Louis1225

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