557 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Commenting out code in VBA Part three of a three-part series of blogs |
---|
Commenting code is an art form! This series of blogs explains why, how and when to comment in VBA.
This blog is part of our Excel macros online tutorial series. Alternatively, come on one of our VBA classroom training courses. |
Rather than have to type an apostrophe before every line of code, you can select a block of code and comment it out:
![]() |
![]() |
Select the code to comment out ... | ... to tell VBA to ignore it |
To do this, you first need to display the correct toolbar.
The easiest way by far to comment out code is using the Edit toolbar:
Right-click on any toolbar in VBA and tick the Edit toolbar to display it
Once you have this visible, you can comment code out as shown below.
To comment out code, first select part or all of the lines of code you want to comment out:
You don't have to select all of each line (here we'll comment out the 3 lines of code wholly or partially selected).
You can then comment the lines out:
Click on the tool shown to comment out selected lines (or the one to its right to comment them back in)
Commenting out code is particularly useful for lines copied from the Internet.
Parts of this blog |
---|
|
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2023. All Rights Reserved.