Monday, December 10, 2018

What is VBA - Constants?

VBA - Constants : 

Constant is a named memory location used to hold a value that CANNOT be changed during the script execution. If a user tries to change a Constant value, the script execution ends up with an error. Constants are declared the same way the variables are declared.
  • You must use a letter as the first character.
  • You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name.
  • Name can't exceed 255 characters in length.
  • You cannot use Visual Basic reserved keywords as variable name.

Syntax

In VBA, we need to assign a value to the declared Constants. An error is thrown, if we try to change the value of the constant.
http://www.tutorialspoint.com/

No comments:

Post a Comment