Comments are use basically notes which are used to increase the readability of the code. Comments does not execute while running a code. We also can disable the some part of code by using the comments.
IF we put Single Quotation mark (‘) or “Rem” keyword before a code line then it will become a comment.
Sub test1() 'this is a comments Rem this is a comments Dim t As Long t = 40000 End Sub
We can comments multiple line together by using Edit window in Visual basic editor.
To open the edit window in Visual Basic Editor- Go to View>>Toolbars>>Edit
Below given window will be displayed
Select the multiple line you your code and click on Comments Block button (highlighted in below image)
Selected line will be Comments and will not be executed during the code execution.
To Uncomments select the lines and click on Uncomments Block button (highlighted in below image)
Selected line will be Uncomments and will be executed during the code execution.