PDA

View Full Version : Some Probably very basic VBA questions.



Endorphin
12-08-2008, 01:00 AM
Good Morning All and Seasons greetings if it?s not to early! :dunno

If have been using VBA for a little while but have never been taught (cannot seem to learn from a book) apart from sites like these, with help from people like you, that said I have a few very probably basic questions.

:think:

What is the difference between putting a Macro I a sheet rather than a module?
Can a Macro be moved between Modules without any issues?
How many Macros can a Module/Sheet contain?
Does question 4 affect speed if there are lots?
Do comments/empty lines slow the operation of a Macro down?
As always, you help :bow: is very much appreciated.

Neil

Bob Phillips
12-08-2008, 01:47 AM
<snip> ... that said I have a few very probably basic questions.

What is the difference between putting a Macro I a sheet rather than a module?

Code in a sheet module should only be code related to events on the worksheet, or worksheet evnts themselves.


Can a Macro be moved between Modules without any issues?

Yes.


How many Macros can a Module/Sheet contain?

As many as you like, but it can only be 64Kb ins size, and should be kept to a manageable number, preferably functionally grouped.


Does question 4 affect speed if there are lots?

No, it is the code that affects speed.


Do comments/empty lines slow the operation of a Macro down?

No.

Endorphin
12-08-2008, 01:51 AM
Many Thanks XLD