Excel - Macro Limitations

Asked By Cinderell on 05-Aug-08 04:01 PM
I have a macro that has a limitation of 5000 lines. Is it possible to create
a larger macro (greater than 5000 lines) ?

Joe replied on 05-Aug-08 04:06 PM
A macro really shouldn't be more than 200 to 500 line.  Yo ushould make
multiple subroutines and call one from another

sub main()

call sub1()
call sub2()
call sub3()
end sub

sub sub1()

end sub

sub sub2()

end sub

sub sub3()

end sub
Wig replied on 05-Aug-08 04:08 PM
You're probably copy-pasting analogous code over and over again.

Try to avoid that.

Try to group commands that reappear into another procedure, that you call in
your main procedure. If you want, you can use parameters in these procedures,
if some things are just "a little be different".

I know this is rather vague, but so is your question... ;-)

http://www.wimgielis.be = Excel/VBA, soccer and music