In the VBA editor, go to View
, Toolbars
, Customise...
or right click on the tool bar and select Customise...
Under the Commands
tab, select the Edit
menu on the left.
Then approximately two thirds of the way down there’s two icons, Comment Block
and Uncomment Block
.
Drag and drop these onto your toolbar and then you have easy access to highlight a block of code, and comment it out and uncomment with the click of a button!
See GauravSingh’s answer if you want to assign keyboard shortcuts.
Related Posts:
- What does <> mean?
- How to find a value in an excel column by vba code Cells.Find
- Check if a string contains another string
- VBScript to open a dialog to select a filepath
- Does VBA have Dictionary Structure?
- “Sub or Function not defined” when trying to run a VBA script in Outlook
- What is the function of FormulaR1C1?
- What exactly is the function of Application.CutCopyMode property in Excel
- VBA Excel – Insert row below with same format including borders and frames
- Deleting a file in VBA
- Excel VBA: Can’t get a match, error “Unable to get the Match property of the WorksheetFunction class”
- Run-time error ‘3061’. Too few parameters. Expected 1. (Access 2007)
- Pass arguments to Constructor in VBA
- How to install Date Picker form control in Excel 2016
- How to install Date Picker form control in Excel 2016
- How to fill color in a cell in VBA?
- Refreshing all the pivot tables in my excel workbook with a macro
- VBA: Run time error ’91’?
- Compare Dates in VBA
- What is the difference between “Form Controls” and “ActiveX Control” in Excel 2010?
- ‘Cannot find DAO350.dll’ file error VB6
- Average in VBA in Excel
- VBA Excel “Compile error: Object Required”
- Choosing paper size (NOT DEFAULT sizes) in excel vba
- “Unable to get the VLookup property of the WorksheetFunction Class” error [duplicate]
- Paste Special error 1004 PasteSpecial method of Range class failed
- VBA: Getting run-time 1004: Method ‘Range’ of object ‘_Worksheet’ failed when using cells
- Cannot run the macro… the macro may not be available in this workbook
- Is there a way to create multiline comments in Python?
- Is it bad practice to comment out single lines of CSS with //?
- Can comments be used in JSON?
- Can comments be used in JSON?
- How do I comment out a block of tags in XML?
- Is there a way to convert all comments into javadoc comments? [Eclipse/Java]
- How do I comment out a block of tags in XML?
- How do you do block comments in YAML?
- Can comments be used in JSON?
- How do you comment out code in PowerShell?
- Comments in Markdown
- Comments in Markdown
- How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
- Visual Studio /**/ comment shortcut?
- How to “comment-out” (add comment) in a batch/cmd?
- How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
- Object Required Error in excel VBA
- What are .NumberFormat Options In Excel VBA?
- Is ‘# -*- coding: utf-8 -*-‘ also a comment in Python?
- Better way to find last used row
- VBA, if a string contains a certain letter
- Excel VBA Macro: User Defined Type Not Defined
- lists and arrays in VBA
- VBA Runtime Error 1004 “Application-defined or Object-defined error” when Selecting Range
- Select method of Range class failed via VBA
- How to add comments into a Xaml file in WPF?
- Does VBA contain a comment block syntax?
- Is it possible to have a multi-line comments in R?
- What is the common header format of Python files?
- Why does “Paste Method of Worksheet class failed” occasionally occur?
- How to “comment-out” (add comment) in a batch/cmd?
- How to return a result from a VBA function
- How to clear memory to prevent “out of memory error” in excel vba?
- Use VBA to Clear Immediate Window?
- Multi-Line Comments in Ruby?
- VBA: Else without If Error
- Recommended IDE for VBA
- ByRef argument type mismatch in Excel VBA
- How to write a comment in a Razor view?
- How to write an inline-comment in Python
- VBA: Convert Text to Number
- VBA Error: “Compile error: Expected End Sub”
- Scraping data from website using vba
- Error: “Could Not Find Installable ISAM”
- Loop without Do error
- R: Comment out block of code
- Row count where data exists
- VBA array sort function?
- What’s a quick way to comment/uncomment lines in Vim?
- Test or check if sheet exists
- How to detect if user select cancel InputBox VBA Excel
- macro run-time error ‘9’: subscript out of range
- single line comment in HTML
- How to Clear Office Clipboard with VBA
- Why does my VBA code throw an “Invalid outside procedure” error?
- Details of difference between @see and @inheritDoc
- Excel Solver Password: what is it and where can it be acquired/bought?
- Using Excel VBA to run SQL query
- Compile error: Next without For || VBA
- Is there a way to crack the password on an Excel VBA Project?
- Multi-Line Comments in Ruby?
- How to change “Leave a Reply” title in wordpress twentyfifteen theme
- Where can I find the “Leave a Reply” line in the WordPress SmartBiz.1.1.1 theme?
- Show comments on WordPress home page
- Why do I get comment spam even with Akismet and Captcha?
- Is there ANY way to remove comments function and section totally?
- What tools are available for managing/writing to WordPress? [closed]
- How to rearrange fields in comment_form()
- setting comments off as default for pages and custom post types?
- how to reduce the number of spam comments
- Is it possible to pull comments from facebook into your blog?
- Find out which moderator approved comment?