Module Comments

J

jfcby

Hello,

Is there a way to insert comments in a module outside of subs and
functions that will not cause errors when running the code?

jfcby
 
P

Per Jessen

Insert a single quote sign as the first character in the comment line.

' Here's a comment

Regards,
Per
 
J

jfcby

Per,

Thanks for the reply.

But, when running some macros they error out using ' to comment out
lines of code.

Is that the only way to comment code in vba?

jfcby
 
G

Gord Dibben

Using the ' to exclude comments will fail only if you have made a mistake
somewhere in the placement of these comments.

Perhaps you inserted a comment after a line-continuation mark(_)

Post an example of code that fails.

You can always use Rem instead of the ' but can also fail for the same
reason as above.


Gord Dibben MS Excel MVP
 
Top