PC Review


Reply
Thread Tools Rate Thread

Add a ' in front of all highlighted code in VBA

 
 
RyanH
Guest
Posts: n/a
 
      15th Oct 2008
I remember reading this somewhere and can't find it. Is there a way to add a
' in front of all the code that is highlighted in VBA? For example, I want
ignore a portion of code for testing, I highlight the code and do something
to make them all comments. Plus I would like to beable to switch it back.

--
Cheers,
Ryan
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      15th Oct 2008
I don't think there is a keyboard shortcut available; however, you can add
two buttons to the toolbar to make the task doable with a single mouse
click. Click View/Toolbars/Customize from the VB editor's menu bar, click
the Commands tab on the dialog box that appears, select Edit from the
Categories list and then scroll down until you find "Comment Block" and
"Uncomment Block" in the Commands list. Click, drag and drop each one of
them onto the menu bar. You can now Close the Customize dialog box. To use
the buttons, highlight several lines of code and click the "Comment Block"
icon and those line will turn into comments. Highlight any comment lines and
click the "Uncomment Block" icon and those lines will become normal
statements.

--
Rick (MVP - Excel)


"RyanH" <(E-Mail Removed)> wrote in message
news:EA7EF791-A1A3-494D-B73F-(E-Mail Removed)...
>I remember reading this somewhere and can't find it. Is there a way to add
>a
> ' in front of all the code that is highlighted in VBA? For example, I
> want
> ignore a portion of code for testing, I highlight the code and do
> something
> to make them all comments. Plus I would like to beable to switch it back.
>
> --
> Cheers,
> Ryan


 
Reply With Quote
 
RyanH
Guest
Posts: n/a
 
      15th Oct 2008
Now I remember. Thanks!
--
Cheers,
Ryan


"Rick Rothstein" wrote:

> I don't think there is a keyboard shortcut available; however, you can add
> two buttons to the toolbar to make the task doable with a single mouse
> click. Click View/Toolbars/Customize from the VB editor's menu bar, click
> the Commands tab on the dialog box that appears, select Edit from the
> Categories list and then scroll down until you find "Comment Block" and
> "Uncomment Block" in the Commands list. Click, drag and drop each one of
> them onto the menu bar. You can now Close the Customize dialog box. To use
> the buttons, highlight several lines of code and click the "Comment Block"
> icon and those line will turn into comments. Highlight any comment lines and
> click the "Uncomment Block" icon and those lines will become normal
> statements.
>
> --
> Rick (MVP - Excel)
>
>
> "RyanH" <(E-Mail Removed)> wrote in message
> news:EA7EF791-A1A3-494D-B73F-(E-Mail Removed)...
> >I remember reading this somewhere and can't find it. Is there a way to add
> >a
> > ' in front of all the code that is highlighted in VBA? For example, I
> > want
> > ignore a portion of code for testing, I highlight the code and do
> > something
> > to make them all comments. Plus I would like to beable to switch it back.
> >
> > --
> > Cheers,
> > Ryan

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Front End Code is Gone CJ Microsoft Access Form Coding 4 19th Jan 2008 12:47 AM
Color Code report - go through each row, compare with previous record, if different, highlighted all fields in the current row richiecheng@gmail.com Microsoft Access Reports 4 8th Nov 2007 01:21 AM
Code for testing whether a cell or row is highlighted? =?Utf-8?B?SkBZ?= Microsoft Excel Programming 6 28th May 2007 07:08 PM
I NEED A '0' (ZERO) IN FRONT OF THE ZIP CODE =?Utf-8?B?WmV0b255?= Microsoft Access 7 28th Dec 2005 04:59 PM
cells highlighted and unable to remove highlighted debbie Microsoft Excel Worksheet Functions 1 3rd Oct 2004 05:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:42 PM.