ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lines in a Module(Procedure) (https://www.excelbanter.com/excel-programming/286430-lines-module-procedure.html)

Juan Melero

Lines in a Module(Procedure)
 
I sometimes get a message that my procedure is too long.
How many lines of code does a procedure hold?
Thanks for the reply in advance.

pikus

Lines in a Module(Procedure)
 
How many lines are you dealing with? What is the exact message? Do you
know it verbatim? - Pikus


---
Message posted from http://www.ExcelForum.com/


Dave Peterson[_3_]

Lines in a Module(Procedure)
 
the rule of thumb around here is that procedures shouldn't be bigger than 64k
when you export it to a text file.

But that's just a rule of thumb. I don't think the actual limit is documented
anywhere.

Juan Melero wrote:

I sometimes get a message that my procedure is too long.
How many lines of code does a procedure hold?
Thanks for the reply in advance.


--

Dave Peterson


Juan Melero

Lines in a Module(Procedure)
 
I don't know what the exact message was but I know I had
alot of lines because what I did was record a macro in
Excel. I had a spreadsheet that is around 4 Pages long
and when I looked at the code it was huge. When I ran the
macro it gave me the message so I broke down the code into
sub procedures until I did not get the message anymore. I
was just wondering if it said an exact number somewhere.
You should try this to see if you can come up with the
exact number. My rule of thumb is not to write a
procedure that is longer than a page or page and 1/2.
-----Original Message-----
How many lines are you dealing with? What is the exact

message? Do you
know it verbatim? - Pikus


---
Message posted from http://www.ExcelForum.com/

.


Harlan Grove[_5_]

Lines in a Module(Procedure)
 
"Dave Peterson" wrote...
the rule of thumb around here is that procedures shouldn't be bigger than 64k
when you export it to a text file.

But that's just a rule of thumb. I don't think the actual limit is documented
anywhere.

...

64KB in one module I can understand, but 64KB in one *procedure*? Even if lines
of code averaged 64 characters (including the ending newline sequence), that'd
be a 1024 line procedure, so spanning just a bit more than 17 60-line pages in
printout. A single prodedure of that size is a REALLY BAD IDEA!



pikus

Lines in a Module(Procedure)
 
I'll heve to be careful then. I do get carried away sometimes... -
Pikus


---
Message posted from http://www.ExcelForum.com/


Dave Peterson[_3_]

Lines in a Module(Procedure)
 
Oops. I meant Module!

Sorry about the error and thanks for the correction.



Harlan Grove wrote:

"Dave Peterson" wrote...
the rule of thumb around here is that procedures shouldn't be bigger than 64k
when you export it to a text file.

But that's just a rule of thumb. I don't think the actual limit is documented
anywhere.

..

64KB in one module I can understand, but 64KB in one *procedure*? Even if lines
of code averaged 64 characters (including the ending newline sequence), that'd
be a 1024 line procedure, so spanning just a bit more than 17 60-line pages in
printout. A single prodedure of that size is a REALLY BAD IDEA!


--

Dave Peterson



All times are GMT +1. The time now is 12:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com