LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Fixed width parsing with trailing minus

I'm not sure how you're building this, but maybe one of these will help:

Dim myArray() As Variant

ReDim myArray(1 To 5, 1 To 2)
myArray(1, 1) = 0
myArray(1, 2) = 1

myArray(2, 1) = 9
myArray(2, 2) = 1

myArray(3, 1) = 23
myArray(3, 2) = 1

myArray(4, 1) = 34
myArray(4, 2) = 1

myArray(5, 1) = 48
myArray(5, 2) = 1

'or

Dim myArr As Variant
myArr = Array(Array(0, 1), Array(9, 1), Array(23, 1), _
Array(34, 1), Array(48, 1))


MSweetG222 wrote:

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


--

Dave Peterson
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
trailing minus via135 Excel Worksheet Functions 10 November 25th 07 06:51 PM
CHANGE TRAILING MINUS TO BRACKETS OR PRECEEDING MINUS Socal Analyst looking for help Excel Discussion (Misc queries) 2 May 12th 06 07:17 PM
Importing values w/trailing minus signs RWN Excel Discussion (Misc queries) 1 December 11th 04 05:05 AM
Automatically Parsing Fixed-width Text Import Bill[_29_] Excel Programming 3 October 5th 04 06:11 AM
Fixed Width - Opening Certain Fixed Width Files Jan[_8_] Excel Programming 2 December 30th 03 08:31 PM


All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"