Comment block of code?

R

Rick Charnes

Is there a way to comment an entire multi-line block of VBA code? If I
have 10 lines I want to comment, it's frustrating to have to insert an
apostrophe in front of each one. Thanks.
 
B

Bear

Rick:

In the VBE, display the Edit toolbar.

On the Edit toolbar you'll find the Comment Block button which does exactly
what you want. (There's also an Uncommend Block for later.)

Bear
 
S

Shauna Kelly

Hi Rick

Select all the lines of text you want to comment and click the "Comment
Block" button on the Edit menu.

For what it's worth, I always customize the Edit Menu so as to display the
text as well as the icons, and then change the captions to &Comment Block
and &Uncomment Block. Then, I can select the relevant lines and do Alt-c and
Alt-u.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
R

Rick Charnes

Thanks; do you mean the Edit TOOLBAR? I didn't have the Edit toolbar
displayed and now that I've turned it on I now see the Comment Block
button. But I don't see this option on the edit MENU as you indicate
here. Thanks.
 

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

Top