FieldInfo:=Array(Array(0, 5), Array(8, 1))
I am trying to use text to columns fixed width.
For this, I have recorded a macro.
I can understand some of the code since I am new to VBA.
However, The above code is not clear.
Can someone explain what this code does?
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 xlColumnDataTypeconstants specifying how the column is parsed.
Array(Array(3, 9), Array(1, 2))
If the source data has fixed-width columns, the first element of each two-element array specifies the starting character position in the column (as an integer; 0 (zero) is the first character). The second element of the two-element array specifies the parse option for the column as a number from 1 through 9, as listed above.
Array(0, 5) the 1st column starts at character #0 (the first char) and the type is
YMD date (type 5)
Array(8, 1) the 2nd column starts at character #8 (the ninth char = the first column is 8 char wide) The second column’s type is
General (type 1)