Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code for testing whether a cell or row is highlighted? | Excel Programming | |||
How do I keep zeros in front of other numbers (like a zip code)? | Excel Discussion (Misc queries) | |||
Saving a CSV file from Excel with 0 in front of Zip code | Excel Discussion (Misc queries) | |||
Highlighted | New Users to Excel | |||
front end zero | Excel Discussion (Misc queries) |