Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Add a ' in front of all highlighted code in VBA

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Add a ' in front of all highlighted code in VBA

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" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Add a ' in front of all highlighted code in VBA

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for testing whether a cell or row is highlighted? J@Y Excel Programming 4 May 28th 07 07:08 PM
How do I keep zeros in front of other numbers (like a zip code)? RitoruIkko Excel Discussion (Misc queries) 2 June 30th 06 03:19 PM
Saving a CSV file from Excel with 0 in front of Zip code ChuckW Excel Discussion (Misc queries) 10 June 8th 06 06:35 PM
Highlighted ED New Users to Excel 5 April 13th 06 09:31 PM
front end zero Tdilly Excel Discussion (Misc queries) 1 September 1st 05 06:56 PM


All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"