Let Statement

 

[Let] variablename = expression

 

Let assigns a value to a variable.

 

Let is an optional keyword that is rarely used. The Let statement is required in older versions of BASIC.

 

Example:

 

Sub Form_Click ()

    Dim Msg, Pi         ' Declare variables.

    Let Pi = 4 * Atn(1)    ' Calculate Pi.

    Msg = "Pi is equal to " & Str(Pi)

    MsgBox Msg          ' Display results.

End Sub