VBA Comment Structure

This section of the VBA learning course reviews the Comment Structure. In every programming language, you need to have the ability to write comments within your code. Adding comments is a useful way to remember logic, versions, or even ideas.

In VBA, comments can be added using two methods:

  • Single Quote (‘)
  • REM Keyword

Single Quote (‘) Comment Method

By adding a single quote (‘) at the start of a line, the entire statement is treated as a comment.

Single Quote Comment in VBA
Single Quote comment in VBA

REM Keyword Method

Any line that starts with REM will be treated as a comment.

REM Keyword Method
REM Keyword Method for comments

Leave a Reply

If Function

The IF Function in excel is a logical test that can be run using specific conditions. This logical test returns

Read More »

RANK Function

The Excel Rank function returns the numeric value when compared to a list of numeric values. You can rank lists

Read More »
Scroll to Top