Module Comments

  • Thread starter Thread starter jfcby
  • Start date Start date
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
 
Insert a single quote sign as the first character in the comment line.

' Here's a comment

Regards,
Per
 
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
 
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
 

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

Back
Top