Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Does anyone have code to rename the modules

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That would be so handy instead of calling it module1 call it a name any Ideas??

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In the Project Explorer, you can select any module, then hit F4 to pull up the (single-entried) properties box. This lets you change the name manually.

    Or you can do something like
    ActiveWorkbook.VBProject.VBComponents("Module1").Name = "xyzzy"

    (You can also use objects like
    ActiveWorkbook.VBProject.VBComponents("Module1").CodeModule to do all sorts of wacky dynamic things to your VBA code.)

    "Interfere? Of course we should interfere! Always do what you're best at, that's what I say!" -- The Doctor, Nightmare of Eden

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •