VBA module names in Excel

Solved
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 answers

  • Votes
  • Date
  • Descending date
  1. Contributor
    Hello Mistal, gbinforme

    when you have selected (simple left click) your module, you press F4 and you give the chosen name
    --
    :-x
    1. 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
  2. Contributor
    Hello Mistral,

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

    Always zen
    1. 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.
  3. Contributor
    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
    1. 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
    2. Late but with 2010, make sure the module is completely empty, it works!