Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See one more suggestion at your other post.
bw wrote: I have the following procedure, and it works as it should. Sub OPENTHEFILE() Workbooks.OpenText Filename:="C:\DownLoads\LAS6014", Origin:=437, StartRow _ :=1, DataType:=xlFixedWidth, FieldInfo:=Array( _ Array(Range(DA(2, 0)), Range(DA(2, 1))), _ Array(Range(DA(3, 0)), Range(DA(3, 1))), _ Array(Range(DA(4, 0)), Range(DA(4, 1))), _ Array(Range(DA(5, 0)), Range(DA(5, 1)))), _ TrailingMinusNumbers:=True End Sub Now I want to obtain a value for the DA array from my worksheet indicating how many fields there will be, and then loop through the OPENTHEFILE procedure depending on the number of fields. So I'm looking for something like the following (although I KNOW the following is NOT correct): Sub OPENTHEFILE() Workbooks.OpenText Filename:="C:\DownLoads\LAS6014", Origin:=437, StartRow _ :=1, DataType:=xlFixedWidth, FieldInfo:=Array( _ For x = 0 To VariableFromWorksheet Array(Range(DA(x, 0)), Range(DA(x, 1))), _ Next x TrailingMinusNumbers:=True End Sub Something like that! I hope you get the idea... Can anyone help? Thanks, Bernie -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to Sum last 10 values of a dynamic column excluding zero | Excel Discussion (Misc queries) | |||
Stop a Procedure from another procedure | Excel Discussion (Misc queries) | |||
Dynamic Range of Cell Values in a single Row | Excel Discussion (Misc queries) | |||
simplify procedure to get rid of 0 error values in a spreadsheet | Excel Worksheet Functions |