VBA Procedure too Large
Written by
Reviewed by
This article will explain the VBA procedure too large error.
There are 2 main reasons that this error can appear in Excel VBA.
Check Excel Version
This error can occur if you are running a 32-bit version of Excel, but you have a very large procedure which would be better off being run in a 64-bit environment.
Just because your PC is 64-bit does not necessarily mean that your version of the Microsoft Office is 64-bit, so you will need to check your Excel version.
In the Ribbon, select File, then (1) select Account and then (2) About Excel.
Check in the information that appears about Excel – it will let you know if you are running the 32-bit or 64-bit version of Office.
If you need to upgrade to the 64-bit version, make sure that it will not effect any add-ins or other macros that you use. Most add-ins and macros need to be customized to run on the 64-bit version of office and older add-ins may not run at all.
Decrease the Size of Your Procedure
The other main reason is that your Procedure is, simply, too large! You need to try and decrease the size of your procedure by using Loops or Nested Procedures instead of having the code all in a single procedure.
You can for example break down your code into separate procedures and then call the separate procedures in your main procedure.
For example: