+ Reply to Thread
Results 1 to 8 of 8

Why are certain Macros grouped in a single Module?

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Why are certain Macros grouped in a single Module?

    When I select the "View Macros" option in Macros and select one to view, it gives me the option to scroll up and down and view several other macros. Usually about 3 or 4 of them will be in the same module. What I don't understand is how it decides which macros are in a given module. I simply select "Record Macro" from the menu and it groups certain modules in "Module 29" and others in "Module 34" etc. How does it decide this?

  2. #2
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Why are certain Macros grouped in a single Module?

    Unless the macros are created using personal worokbook, each work book has its own module. Unless you change the name of the macro, it will be given a default name which is a sequential number. So, it is most likley that you have created these macro and are saved on your personal workbook with a dafault name number. If you had created each macro using this workbook instead of personal workbook,you can only see that modul which is linked with that macro

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Why are certain Macros grouped in a single Module?

    In the below example, these 2 macros are viewed together when I click edit "ClearHAFAoverview". I don't know what puts them in the same page when other macros aren't. I recorded them separately and named them differently.


    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Why are certain Macros grouped in a single Module?

    This is really weird.I have not came across this issue before.

  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: Why are certain Macros grouped in a single Module?

    I have faced this several times but i never bothered to actually check why it happens.

    So today i decided to test this out. I recorded a few test macros and they all came one below the other in the same module. Then i thought of waiting a while and then resume the testing. I worked on another solution in the meantime and came back to my test file and did another macro. This too came below the existing macros in the same module.
    Then i saved the file and closed it. Opened it immediately and recorded another test macro. This macro got saved in a different module.
    So this is what i concluded - whatever macros you record within that instance of the file being open go into one module. If you close and open the file, it goes into another module.

    This was my experience with the testing and i could be wrong on my inferences but just telling you what i did and what i concluded. Lets see what others have to say.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Why are certain Macros grouped in a single Module?

    Arlu,
    Good to see people are contributing to this thread. Did you record your macro on personal workbook, or this workbook? I suspect this may make a difference to what you have already tested.

  7. #7
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: Why are certain Macros grouped in a single Module?

    I was running it in a regular workbook and the codes were getting saved in modules.

  8. #8
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Why are certain Macros grouped in a single Module?

    What I meant was: there are three options for storing macros. This workbook, New workbook and personal workbook.
    If you just hit the record macro button, the macro will be saved in to the default folder, using the default number name. All subsequent recorded macros will be saved in the same module. Excel will not create a new module every time you record a new macro unless of course you have chosen to save it in "New book" and which then would appear on a separate module.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1