M
MSweetG222
I have written a macro that parses fixed width text files using a parse line
based upon a parse string on a worksheet cell.
Cell A1 = "[xxx] [xxxxxxxx]"
---------------------
sParseString = Sheet("Sheet2").Range("A1").Value
Worksheets("Sheet1").Columns("A").Parse _
parseLine:sParseString, _
destination:=Worksheets("Sheet1").Range("B1")
---------------------
The users just change the parse line (then one stored on a worksheet cell),
then macro picks up the parse line value and uses the variable in the macro.
Everything worked just fine. If the fixed with was different, user just
changed the parse cell on worksheet and the macro works.
Now they are receiving fixed width text files with trailing minus signs.
I want to switch to this method...
Selection.TextToColumns Destination:=Range("A:A"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(9, 1), Array(23, 1), Array(34 _
, 1), Array(48, 1)), TrailingMinusNumbers:=True
And I can figure out where the "brackets" are in the parse line to compute
the numbers in the array above, but I don't know how to "build" an array
within an array.
Can someone give me help on how to do this?
Thanks for your help.
MSweetG222
based upon a parse string on a worksheet cell.
Cell A1 = "[xxx] [xxxxxxxx]"
---------------------
sParseString = Sheet("Sheet2").Range("A1").Value
Worksheets("Sheet1").Columns("A").Parse _
parseLine:sParseString, _
destination:=Worksheets("Sheet1").Range("B1")
---------------------
The users just change the parse line (then one stored on a worksheet cell),
then macro picks up the parse line value and uses the variable in the macro.
Everything worked just fine. If the fixed with was different, user just
changed the parse cell on worksheet and the macro works.
Now they are receiving fixed width text files with trailing minus signs.
I want to switch to this method...
Selection.TextToColumns Destination:=Range("A:A"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(9, 1), Array(23, 1), Array(34 _
, 1), Array(48, 1)), TrailingMinusNumbers:=True
And I can figure out where the "brackets" are in the parse line to compute
the numbers in the array above, but I don't know how to "build" an array
within an array.
Can someone give me help on how to do this?
Thanks for your help.
MSweetG222