VBA module names in Excel

Solved
Mistral_13200 Posted messages 649 Status Membre -  
 danbo -
Hello,

I created a workbook with macros and I now have about ten different modules that are simply named Module1, Module2, Module3...
I would like to know if it is possible to rename them to have more explicit names, which would make it easier to find my way around.
Is it possible?
Is it impossible?

Thank you in advance.
Best regards.
Mistral
Configuration: Windows XP Internet Explorer 7.0

3 réponses

michel_m Posted messages 18903 Registration date   Status Contributeur Last intervention   3 320
 
Hello Mistal, gbinforme

when you have selected (simple left click) your module, you press F4 and you give the chosen name
--
:-x
7
Mistral_13200 Posted messages 649 Status Membre 4
 
Sorry, but it doesn't work for me.
I'm using Excel 2003 and Windows Pro SP3.
When I select my module and press F4, nothing happens, and yet I'm sure of my function keys because when I do Alt+F4 from VBA, I close VBA.
Do you have any ideas since now I believe I have understood that it is possible to rename a module.
Best regards
Mistral
0
gbinforme Posted messages 14930 Registration date   Status Contributeur Last intervention   4 742
 
Hello Mistral,

In VBA, just select the module, then properties, and enter the appropriate name.
--

Always zen
1
Mistral_13200 Posted messages 649 Status Membre 4
 
Hello GBinforme,

I'm using Excel 2003 and it's not working.
When I select a module, a right-click opens a context menu that only gives me access to the properties of the entire project.
It's not the project I want to rename, but just module5 for example.
0
michel_m Posted messages 18903 Registration date   Status Contributeur Last intervention   3 320
 
Sorry, it works for me (Office 2003)...

Have you activated the Project Explorer (Ctrl+R)
With your module selected (highlighted)
Try without using the shortcut key:

View - Properties window

You should have a window where you enter the name on the "name" line

Otherwise, I don't see...
--
:-x
0
Mistral_13200 Posted messages 649 Status Membre 4
 
OK, it's good, I was able to rename my modules as I wanted.
It is now clearer.
A big thank you to everyone.
Best regards.
Mistral
0
danbo
 
Late but with 2010, make sure the module is completely empty, it works!
0