Edit Comment Macros in Excel VBA Code

Home/Excel VBA/Edit Comment Macros in Excel VBA Code

In this tutorial we will see how to Edit Comment Macros in Excel VBA Code.



50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates

Edit Comment Macros in Excel VBA Code: Editing or Modifying VBA Code

Macro recorder will produce lot more code than required, it store almost every action which you are performing after start recording the macro. We can open the code and delete any statement if it is not required. If you want to see the code, you can open the code window (by pressing Alt+F11) and change the code as per your requirement. If you have little command on VBA, it will be easy to change the code as per your requirement.

Edit Comment Macros in Excel VBA Code: Commenting VBA Code

Comments are the statements which are not executable. We comment the statements if you do not want to execute it or if you want provide some information in the code. It is always a good practice to provide the comments while coding, it will be easier to read and maintain the the code as program size increases. And others also can understand your code easily if you provide some comments in the code. In this topic we will see how to provide the comments.

Comment statements are prefixed with a single quote(‘). See the following example code, comments will highlight in the green in code modules.

Sub sbExampleInputBox()
'Declaring a variable to store the inputbox value
'Dim statement creates a String variable called uName
Dim uName As String
'Accepting the value from the user and (right side statement)
'assigning that value into the variable uName ('=' is an assignment operator)
uName = InputBox("Please Enter Your Name")
'Displaying the value storeed in the variable using Message Box
MsgBox uName
End Sub
By |March 17th, 2013|Excel VBA|0 Comments

About the Author:

PNRao is a passionate business analyst and having close to 10 years of experience in Data Mining, Data Analysis and Application Development. This blog is his passion to learn new skills and share his knowledge to make you expertise in Data Analysis (Excel, VBA, SQL, SAS, Statistical Methods, Market Research Methodologies and Data Analysis Techniques).

Leave A Comment

Related pages

macro programming in excelcan you unprotect an excel spreadsheethow to unhide everything in excelexcel pivotchartvba code for vlookupexcel unprotect macrohow many rows and columns in excel 2007project timeline template excelcombine multiple excel worksheets into onevlookup partial matchhow to write a vbscript filescripting.filesystemobject delete fileunshare excel workbookexcel shortcut sheetexcel macro applicationleft function vbalistbox excelcombobox excelexcel macros how tofree download gantt chart exceldownloadable gantt charthow do you delete extra pages in excelvba selectionhow to change macros in excelexcel hide duplicatesadding password to excelvlookup advancedusing the sumif functionvlookup meaning in excelfull form of vba in excelvlookup vs hlookupvlookup returns napowerpoint vba referencehow to unprotect a password protected excel sheetexcel formulas for data analysissas macro interview questionsgantt chart excel 2003excel macro offsethow to change all column widths in excelconnect excel to sql databaseexcel schedule plannertutorial vbavba guiexport excel to xmlrecordset getrows vbacool excel formulasuserform listboxprotect sheet excel 2007unprotect the excel sheetsort command in excelprovider msdasqlamazing excel spreadsheetshow unprotect excel sheet without passwordvba function tutorialrun excel macro from batch filelistbox vbahow to protect a workbook in excel 2007vba tutorial accessexcel shortcuts 2007 formulashortcut key to open excelexcel dynamic cell referencerecording macros in excel 2010userform in excelgenpact interview questions for financems excel formulas with examples pdf in hindisum vlookupexcel vba copy sheet to another workbookexcel if statement syntaxhow to use concatenate function in excel 2010excel if not blankexcel vba programming ebookvba selection.findmicrosoft word project management templatenumber of rows in excel 2007how to unlock an excel file that is password protected