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

MINUTE Function

The MINUTE function in Excel returns the minute component of a specified time as a number between 0-59. Syntax: =MINUTE(serial_number)

Read More »
Scroll to Top