Range.TextToColumns (Excel)

Parses a column of cells that contain text into several columns.

The following table shows the results of importing text into Excel for various import settings. Numeric results are displayed in the rightmost column.

TextToColumns (Destination, DataType, TextQualifier, ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar, FieldInfo, DecimalSeparator, ThousandsSeparator, TrailingMinusNumbers)


ActiveCell.TextToColumns

Arguments

Optional arguments

The following arguments are optional

Destination (Range) - A Range object that specifies where Microsoft Excel will place the results. If the range is larger than a single cell, the top left cell is used.

DataType (XlTextParsingType) - The format of the text to be split into columns.

Possible return values are xlDelimited - Default. Indicates that the file is delimited by delimiter characters, xlFixedWidth - Indicates that the data in the file is arranged in columns of fixed widths.

TextQualifier (XlTextQualifier) - Specifies whether to use single, double, or no quotes as the text qualifier.

Possible return values are xlTextQualifierDoubleQuote - Double quotation mark ("), xlTextQualifierNone - No delimiter, xlTextQualifierSingleQuote - Single quotation mark (').

ConsecutiveDelimiter (Boolean) - True to have Excel consider consecutive delimiters as one delimiter. The default value is False.

Tab (Tab) - True to have DataType be xlDelimited and to have the tab character be a delimiter. The default value is False.

Semicolon (XlTextParsingType) - True to have DataType be xlDelimited and to have the semicolon be a delimiter. The default value is False.

Possible return values are xlDelimited - Default. Indicates that the file is delimited by delimiter characters, xlFixedWidth - Indicates that the data in the file is arranged in columns of fixed widths.

Comma (XlTextParsingType) - True to have DataType be xlDelimited and to have the comma be a delimiter. The default value is False.

Possible return values are xlDelimited - Default. Indicates that the file is delimited by delimiter characters, xlFixedWidth - Indicates that the data in the file is arranged in columns of fixed widths.

Space (XlTextParsingType) - True to have DataType be xlDelimited and to have the space character be a delimiter. The default value is False.

Possible return values are xlDelimited - Default. Indicates that the file is delimited by delimiter characters, xlFixedWidth - Indicates that the data in the file is arranged in columns of fixed widths.

Other (XlTextParsingType) - True to have DataType be xlDelimited and to have the character specified by the OtherChar argument be a delimiter. The default value is False.

Possible return values are xlDelimited - Default. Indicates that the file is delimited by delimiter characters, xlFixedWidth - Indicates that the data in the file is arranged in columns of fixed widths.

OtherChar - Required if Other is True; the delimiter character when Other is True. If more than one character is specified, only the first character of the string is used; the remaining characters are ignored

FieldInfo (XlColumnDataType) - An array containing parse information for the individual columns of data. The interpretation depends on the value of DataType. When the data is delimited, this argument is an array of two-element arrays, with each two-element array specifying the conversion options for a particular column. The first element is the column number (1-based), and the second element is one of the XlColumnDataType constants specifying how the column is parsed.

Here you can find possible values for XlColumnDataType

DecimalSeparator (String) - The decimal separator that Microsoft Excel uses when recognizing numbers. The default setting is the system setting.

ThousandsSeparator (String) - The thousands separator that Excel uses when recognizing numbers. The default setting is the system setting.

TrailingMinusNumbers - Numbers that begin with a minus character