VBA - Strings

The string datatype allows for a sequence of characters to be assigned to a variable.
Strings are required to be contained in quotation marks.

Here is an example of defining a string.



There are escape sequences that are important for some special cases where non standard characters are required. This is covered in a later chapter.

Code Snippet:

Sub a4_3_Strings()

Dim x As String

x = "This is string 1"


End Sub




Related Sections

Python - Learn the python from the basics up. This fast track example code course will get you creating powerful python programs in no time.



Must Read Articles


VBA and Microsoft Excel - Getting the most out of excel with VBA programming
VBA and Microsoft Word - Getting the most out of word with VBA programming
Application Object - Using the applications features in your code.

Installing VBA and First Program - What do you need to start using visual basic application VBA.