Is it possible to comment several lines at once in VBA?

Posted on

Question :

There is the equivalent of /**/ of c # to comment and VBA instead of using plica in each row

    'Function Prodcet30(a As Double, b As Double) As Double
    'If a = 0 Then
           ' MsgBox ("Por favor introduza o valor a")
           ' Exit Sub
           ' Exit Sub

   ' End If
         ' If b = 0 Then
            'MsgBox ("Por favor introduza o valor b")
         ' Exit Sub
    'End If
   ' Prodcet30 = a * b
   ' End Function


Answer :

There is, but it does not work like in C #, it’s a toolbar, you turn it on like this:

  • Go on display > Toolbars > Edit
  • To comment, you select the code you want to leave in comment and click the “Comment block” option.

  • Toremovethecomment,youmustselectwhereyouwanttoremoveandclickthebutton,”Remove comments from the Block”.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *