If you are getting a message that a procedure is too large for the compiler,
then your procedure is *definitely* too large by any other measure. There
is a limit imposed by the compiler, but well-written code should never
approach that limit. You don't have to "eliminate" any code, but you need to
move code out that procedure and put it into a procedure that is called by
the main procedure. E.g., instead of
Sub AAA()
' do lots of stuff for task #1
' do lots of stuff for task #2
' do lots of stuff for task #3
End Sub
use structured code like
Sub AAA()
CallToOtherProcForTask1
CallToOtherProcForTask2
CallToOtherProcForTask3
End Sub
Sub CallToOtherProcForTask1
' code for task 1
End Sub
Sub CallToOtherProcForTask2
' code for task 2
End Sub
Sub CallToOtherProcForTask3
' code for task 3
End Sub
--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)