tech on the net

MS Excel: CSTR Function (VBA)

In Microsoft Excel, the CSTR function converts a value to a string.

Syntax

The syntax for the CSTR function is:

CStr( expression )

expression is the value to convert to a string.

Applies To

Type of Function

VBA Function Example

The CSTR function can only be used in VBA code. For example:

Dim LValue As String

LValue = CStr(8)

The LValue variable would now contain the string value of "8".