+ Reply to Thread
Results 1 to 3 of 3

Having lots of Modules or Not

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

    Having lots of Modules or Not

    Does anyone know if it makes the file larger or slower when there are lots of modules with only a few macros inside each one. I'm finding that my projects have a lot of modules, but I don't know if excel cares much one way or the other.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Having lots of Modules or Not

    Hi,

    I can't offer a definitive answer with absolute certainty but my opinion is that it probably doesn't make the workbook any slower and almost certainly no larger other than the trivial amount of space required to store a module name.
    VBA code modules are essentially only text .bas files. And I have seen advice that having more procedures in fewer modules can slow things down if oft used procedures are at the bottom of the list of procedures since VBA works from the top when looking for procedure names.

    What prompts the Q? Are you observing some slow running?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Having lots of Modules or Not

    That makes sense. I'm just going through and deleting old code and I can't believe how many modules there are. It seems like the macro recorder creates a new module every time you use it? For my OCD need to clean house, I wanted to compile related macros in the same module. And I wanted to justify the time it took me with a technical need.

+ 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