Size limit on Modules in VBA?

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
305
Office Version
  1. 365
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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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