Functions

String expressions

"String" is a geek word for text. A string of letters. A string expression is about text, like characters (ABC… abc…), digits (0123456789), and special characters (!#*>]{…).

String constants

Remember that numeric constants are things like 33, -1.009, and 32.22. Numeric constants don't change.

There are string constants as well. They have " around them, like "This is a string constant". The stuff inside the " " will never change.

Another example:

line1 = "Who let the dogs out?"

The thing in the quotes is a constant. It will never change.

Numeric expressions

A numeric expression is one that…, er, gives you a number.

Surprise

Here's a numeric expression:

3 - ( aVariable / anotherVariable ^ 2 + 4) * Sqr( yetAnother + 13 )

It has variables (aVariable, anotherVariable, and yetAnother), constants (3, 2, 4, and 13), operators (-, (), /, ^, +, and *), and a function (Sqr(), that calculates square root).

Numeric data types

Each variable has a data type. The data type limits what data you can put into the variable. VBA has about half-a-dozen numeric data types.