VBA - Macro Comments



Comments are used to document the program logic and the user information with which other programmers can seamlessly work on the same code in future.

It includes information such as developed by, modified by, and can also include incorporated logic. Comments are ignored by the interpreter while execution.

Comments in VBA are denoted by two methods.

  • Any statement that starts with a Single Quote (') is treated as comment. Following is an example.

' This Script is invoked after successful login 
' Written by : TutorialsPoint 
' Return Value : True / False
  • Any statement that starts with the keyword "REM". Following is an example.

REM This Script is written to Validate the Entered Input 
REM Modified by  : Tutorials point/user2
Advertisements