Call

D

David

Hello Group,

I have a program that exceeded the allowable amount of code. Because of this
I had to create a call to anothe Sub. All it does is do some calculation on
the worksheet, but it appears as a Sub in the list of available subs. Since
it is a Call, I would not like it to appear in the list. I would not like
anyone to try and run it independantly. Can I make it disappear from the
available list?

Thanks,
David
 
D

Don Guillett

You can label it as
private sub mysub()

However, I'll bet your original can be reduced. You are probably using
selections etc. Post it
 
M

Martin Brown

David said:
Hello Group,

I have a program that exceeded the allowable amount of code. Because of this
I had to create a call to anothe Sub. All it does is do some calculation on
the worksheet, but it appears as a Sub in the list of available subs. Since
it is a Call, I would not like it to appear in the list. I would not like
anyone to try and run it independantly. Can I make it disappear from the
available list?

Ignoring the fact that monolithic slabs of code like that will be a
horrible maintenance trap that will come back to haunt you.
Two easy ways to hide internal subroutines:

Declare them as "private" or give them parameters. The latter offers a
way to parameterise your problem and avoid spurious duplication of code.

Regards,
Martin Brown
 
D

David

Thanks Don.

That did it and I just went through another sub and reduced it by over 50%,
so you are right. It is mostly a time and effort thing.

Thanks Again,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top