Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

Let Statement

Assigns a value to a variable.

Syntax:

Let Statement diagram


[Let] variable = expression

Parameters:

variable: Variable that you want to assign a value to. Value and variable type must be compatible.

As in most BASIC dialects, the key word Let is optional.

Example:


Sub ExampleLet
Dim sText As String
    Let sText = "Las Vegas"
    MsgBox Len(sText) ' Returns 9
End Sub