ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Module Comments (https://www.excelbanter.com/excel-programming/427338-module-comments.html)

jfcby

Module Comments
 
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

Per Jessen

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

' Here's a comment

Regards,
Per

"jfcby" skrev i meddelelsen
...
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



jfcby

Module Comments
 
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

Gord Dibben

Module Comments
 
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


On Wed, 22 Apr 2009 12:31:58 -0700 (PDT), jfcby wrote:

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




All times are GMT +1. The time now is 07:31 PM.

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