Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() you'll still need to know the number of columns.. but then you can shorten it to: Dim i, va(97) 'assuming option base 0 For i = LBound(va) To UBound(va) va(i) = Array(i, 2) Next Workbooks.OpenText Filename:="D:\data.txt", _ Origin:= 437, StartRow:=1, _ DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, _ Tab:=True, Semicolon:=False, Comma:=False, _ Space:=False, Other:=False, _ Fieldinfo:=va not perfect.. but it looks better :) keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "GPO" <cre@inine wrote: Excel 2000 I am importing a tab delimited file and every column must be set to "text". Is there a more efficient/economical/shorter way of representing the array of arrays that field info requires? It just seems a but verbose. Below is a snippet. Apologies for the wrapping but you get the idea. . . . FieldInfo:=Array( _ Array(1, 2), Array(2, 2), Array(3, 2), Array (4, 2), Array(5, 2), Array(6, 2), Array(7, 2), Array(8, Array(91, 2), Array(92, 2), Array(93, 2), Array (94, 2), Array(95, 2), Array(96, 2), Array(97, 2), Array (98, 2)) . . . Regards GPO |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thnx!
-----Original Message----- you'll still need to know the number of columns.. but then you can shorten it to: Dim i, va(97) 'assuming option base 0 For i = LBound(va) To UBound(va) va(i) = Array(i, 2) Next Workbooks.OpenText Filename:="D:\data.txt", _ Origin:= 437, StartRow:=1, _ DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, _ Tab:=True, Semicolon:=False, Comma:=False, _ Space:=False, Other:=False, _ Fieldinfo:=va not perfect.. but it looks better :) keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "GPO" <cre@inine wrote: Excel 2000 I am importing a tab delimited file and every column must be set to "text". Is there a more efficient/economical/shorter way of representing the array of arrays that field info requires? It just seems a but verbose. Below is a snippet. Apologies for the wrapping but you get the idea. . . . FieldInfo:=Array( _ Array(1, 2), Array(2, 2), Array(3, 2), Array (4, 2), Array(5, 2), Array(6, 2), Array(7, 2), Array(8, Array(91, 2), Array(92, 2), Array(93, 2), Array (94, 2), Array(95, 2), Array(96, 2), Array(97, 2), Array (98, 2)) . . . Regards GPO . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can we Pass String to FieldInfo Array to OpenText Method. | Excel Programming |