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

x
?
Solved

Comment out a larg block of code

Posted on 2001-08-20
12
Medium Priority
?
601 Views
Last Modified: 2012-05-04
How do I comment out a large block of code at once?

In C++ you can do something like:

/*
...
...
Large block of code
...
...
*/

and the whole block will be commented out.  The compiler ignores everything between the /* and the */

How does this work in VBA?
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
  • 3
  • 3
  • 3
  • +2
12 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 6407332
Only an insert of a single quote per line or just "disabling" a whole SUB by changing the name ;-(
are the ways I know.

Nic;o)
0
 
LVL 6

Expert Comment

by:devtha
ID: 6407338
if you want to block from line 3 to 10 then insert a blank line on line 3 and write


line 2
If false then    'now line 3
 line 2  'old line 3
  ..
  ..
  ..
  ..
  line 10
end if
0
 
LVL 6

Expert Comment

by:devtha
ID: 6407341
that was an example of how you can achieve it faster without going to each line and commenting or uncommenting them out...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Author Comment

by:Tom Knowlton
ID: 6407342
Your suggestions are both good, but they are work-arounds.

The VBA IDE does not have this built-in???
0
 
LVL 2

Expert Comment

by:Gudare
ID: 6407358
The VBA IDE doesn't have that built in *for Access* until the XP version.

Fastest way: Cut/paste to Excel VBA IDE. Hit comment selection, cut/paste back.

-Craig
0
 
LVL 4

Expert Comment

by:maatthias
ID: 6407374
You can add this feature to a menu.  Check out this article http://support.microsoft.com/support/kb/articles/Q171/3/88.ASP
0
 
LVL 4

Accepted Solution

by:
maatthias earned 64 total points
ID: 6407392
In short,
In module or form design window, right-mouse click your toolbar, choose Customize..., under Commands tab, choose "Edit".  Find "Comment Block" and "Uncomment Block".  You can drag these to, for example, your Debug menu.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 6407428
maatthias:

Bingo!

Thanks!
0
 
LVL 2

Expert Comment

by:Gudare
ID: 6407447
DOH... um, thanks maathias. I'm gonna go sit in the corner and bang my head on the wall now...

-Craig
0
 
LVL 6

Expert Comment

by:devtha
ID: 6407568
knowlton did it work as this article is not for access.
0
 
LVL 2

Expert Comment

by:Gudare
ID: 6407582
Devtha: It works for AC2k, not 97, in case he doesn't come back since he closed it.

-Craig
0
 
LVL 4

Expert Comment

by:maatthias
ID: 6407646
Specifically, it will with VBA 5.0 and up.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 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