while run the macro it shows errors compile error , Procedure to large , i delete any one row it was working fine. Please give to solution, we need to add some more line in the same macro#
How big is your procedure? The limit is 64K which is quite a big number, so do you have thousands of lines or perhaps you storing a large string or something like that? Your option is splitting the procedure into smaller pieces.
how to split the procedure , please send ASAP
vba - Procedure Too Large - Stack Overflow
not working in my case
my code is 2701 line
i tried it was not working as per below
Sub main ()
Try split into another class.
Or you may need to move to addin.
Please send me the some example for split class
You do not need to literally copy-paste the code from the Stack Overflow example rather need to examine your code and break it logically into small pieces. Where did you get this macro from? Is this a macro recording? I'm just not sure that it is going to work correctly for you anyway as it is too large and not optimized and most likely won't be easy to debug and troubleshoot.What are you trying to achieve, perhaps there is another macro available?
Attach your macro here to debug.
Please find attached macro file
I have solved the original problem (using the same techniques as explained by others in this thread). You have a lot of variables which aren't declared in the macro. I presume you have some other modules which declare these.
Retrieving data ...