Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multiline comments in VBA?

Posted on 2003-11-03
4
Medium Priority
?
8,396 Views
Last Modified: 2010-12-13
I know how to do a single-line comment in VBA:

'This is a comment

Usually when I do multiple lines I just begin each line with a single quote:

'This is comment line 1
'This is comment line 2
'...
'Comment N...


Is there a multiline comment format (as found in other languages)?


As in:

/*Comment line 1
Line 2
Line 3
Line 4
Line 5  */

(Everything between the /* and the */ is marked as a comment.



Just wondering if VBA has the same sort of thing, and I missed it.


Tom
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
syntnx earned 500 total points
ID: 9672844
Tom,

You didnt miss it, it just doesnt exist. Although this may help. To comment multiple lines. Enable the edit toolbar, hignlight lines to comment, and click the "comment block" icon on the edit toolbar (middle of toolbar). This will add the ' to whatever you highlight.

Thats the best MS has given us

syntnx
0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 500 total points
ID: 9672860
no, VBA does not allow/support that type of comment notation.  All VBA comments must begin with a ' (single quote), or , using a very OLD format, comment lines can begin with REM (short for REMARK).

However, if you are using VBA in Access 2000 or above, there is cool set of tools that can be downloaded for free (check out http://www.mztools.com) and they include a tool on the Tool bar that allows you to Comment or Un-comment a BLOCK of lines, as a unit.


by the way, 250 points a way too much for such a BASIC question


AW
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 9672886
syntx:  I know about the "comment / uncomment" block toolbar button, and yes, it is handy.  :)

Arthur:  Thanks for your 2 cents.  I'll keep my points lower for future "easy" questions.  :)
0
 
LVL 15

Expert Comment

by:ameba
ID: 9679801
Maybe you can use this:

#If 0 = 1 Then
      Beep
      Beep
#End If
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question