Size limit on Modules in VBA?

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
275
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2011
Platform
  1. Windows
  2. MacOS
I'm nearing the completion of a macro-enabled workbook that has many modules. I remember seeing some forum posts online that talked about there being a size limit to modules. It seems that the unofficial word is that the limit is 64K for each one.

One post I saw suggested to type the following in the Intermediate window in each module.

Code:
?len(application.VBE.ActiveCodePane.CodeModule.Lines(1,application.VBE.ActiveCodePane.CodeModule.CountOfLines))/1000

This returns a number, and in a few instances, what it returns on my modules is higher than 64. One userform module is even over 100.

However, I have tested my workbook on a few different computers (running different versions of Excel) and everything seems to work fine. So, I'm wondering... should I still break up my modules that are apparently over 64 in size? Or am I okay if I am not receiving an error when using the file?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
That article is referring to VB and not VBA.
 
Upvote 0
Hi Paul. Thanks for this link. The page references VB.NET, but does not say anything about VBA. Is it understood within the VBA community that this also applies to VBA?
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top