In VBA is there a short way to comment out a block of code the same way java uses /*...*/
?
A VBA COMMENT is a green line of text that helps you to describe the written code. In simple words, a comment is a line of text which is not a code and VBA ignores it while executing the code.
Although there isn't a syntax, you can still get close by using the built-in block comment buttons:
If you're not viewing the Edit toolbar already, right-click on the toolbar and enable the Edit toolbar:
Then, select a block of code and hit the "Comment Block" button; or if it's already commented out, use the "Uncomment Block" button:
Fast and easy!
prefix the comment with a single-quote. there is no need for an "end" tag.
'this is a comment
Extend to multiple lines using the line-continuation character, _
:
'this is a multi-line _ comment
This is an option in the toolbar to select a line(s) of code and comment/uncomment:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With