Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Programming a current procedure

Maybe you could even build the array of arrays:

Option Explicit
Sub testme()

Dim FirstRow As Long
Dim LastRow As Long
Dim iRow As Long
Dim wks As Worksheet
Dim myArray As Variant

Set wks = Worksheets("sheet1")

With wks
FirstRow = 1
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
ReDim myArray(FirstRow To LastRow)
For iRow = FirstRow To LastRow
myArray(iRow) = Array(.Cells(iRow, "A").Value, _
.Cells(iRow, "B").Value)
Next iRow
End With

Workbooks.OpenText Filename:="C:\DownLoads\LAS6014", Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

End Sub

I use A1 through the last used row in column A.




bw wrote:

Thank you, Tom!

I THINK I understand what you've suggested. If not, I'll ask again later.

Bernie

On Fri, 18 Jul 2003 12:57:53 -0400, "Tom Ogilvy" wrote:
You would need to put the numbers alone in cells
A1: 0
B1: 1
A1: 34
B1: 1


FieldInfo:=Array(Array(Range("A1"),Range("B1")),Ar ray(Range("A1"),Range("B2"
)))

demoing from the immediate window:

varr = Array(Array(Range("A1"),Range("B1")),Array(Range(" A2"),Range("B2")))
? varr(0)(0)
1

? varr(0)(1)
0

? varr(1)(0)
34

? varr(1)(1)
1


Regards,
Tom Ogilvy


"bw" wrote in message
...
Consider the following procedu

Sub LASMACRO()
Workbooks.OpenText Filename:="C:\DownLoads\LAS6014", Origin:=437,

StartRow _
:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1),

Array(34, 1), Array _
(64, 1), Array(68, 1), Array(69, 1), Array(70, 1), Array(75, 1),

Array(81, 1), Array( _
85, 1), Array(90, 1), Array(95, 1), Array(100, 1), Array(110, 1)),

_
TrailingMinusNumbers:=True
End Sub

On my spreadsheet, I have a column that includes the values for this

procedure. For
example,
Cell A1 = "Array(0,1)"
Cell A2 = "Array(34,1)"
Cell A3 = "Array(64,1)"
etc.

What I'd like to do is to modify the cells in column A on my spreadsheet,

and have these
changes be incorporated into the values for LASMACRO above.

If you understand the problem as I have stated it, can someone suggest a

method on
how to proceed?

Thanks,
Bernie





--

Dave Peterson

  #2   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Programming a current procedure

Dave!

I wrote you a thank you note yesterday, but now I don't see it listed. But I'll say thanks
again. You were able to understand my mumblings about this problem and provide me
with exactly what I was looking for.

Again, thank you very much..

Bernie


On Fri, 18 Jul 2003 20:44:10 -0500, Dave Peterson wrote:
Maybe you could even build the array of arrays:

Option Explicit
Sub testme()

Dim FirstRow As Long
Dim LastRow As Long
Dim iRow As Long
Dim wks As Worksheet
Dim myArray As Variant

Set wks = Worksheets("sheet1")

With wks
FirstRow = 1
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
ReDim myArray(FirstRow To LastRow)
For iRow = FirstRow To LastRow
myArray(iRow) = Array(.Cells(iRow, "A").Value, _
.Cells(iRow, "B").Value)
Next iRow
End With

Workbooks.OpenText Filename:="C:\DownLoads\LAS6014", Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=myArray, _
TrailingMinusNumbers:=True

End Sub

I use A1 through the last used row in column A.




bw wrote:

Thank you, Tom!

I THINK I understand what you've suggested. If not, I'll ask again later.

Bernie

On Fri, 18 Jul 2003 12:57:53 -0400, "Tom Ogilvy" wrote:
You would need to put the numbers alone in cells
A1: 0
B1: 1
A1: 34
B1: 1


FieldInfo:=Array(Array(Range("A1"),Range("B1")),Ar ray(Range("A1"),Range("B2"
)))

demoing from the immediate window:

varr = Array(Array(Range("A1"),Range("B1")),Array(Range(" A2"),Range("B2")))
? varr(0)(0)
1

? varr(0)(1)
0

? varr(1)(0)
34

? varr(1)(1)
1


Regards,
Tom Ogilvy


"bw" wrote in message
...
Consider the following procedu

Sub LASMACRO()
Workbooks.OpenText Filename:="C:\DownLoads\LAS6014", Origin:=437,
StartRow _
:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1),
Array(34, 1), Array _
(64, 1), Array(68, 1), Array(69, 1), Array(70, 1), Array(75, 1),
Array(81, 1), Array( _
85, 1), Array(90, 1), Array(95, 1), Array(100, 1), Array(110, 1)),
_
TrailingMinusNumbers:=True
End Sub

On my spreadsheet, I have a column that includes the values for this
procedure. For
example,
Cell A1 = "Array(0,1)"
Cell A2 = "Array(34,1)"
Cell A3 = "Array(64,1)"
etc.

What I'd like to do is to modify the cells in column A on my spreadsheet,
and have these
changes be incorporated into the values for LASMACRO above.

If you understand the problem as I have stated it, can someone suggest a
method on
how to proceed?

Thanks,
Bernie





--

Dave Peterson




Reply
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
Current year and current week number Grey Old Man[_2_] Excel Discussion (Misc queries) 11 December 8th 09 06:30 PM
Stop a Procedure from another procedure Ayo Excel Discussion (Misc queries) 1 October 30th 08 01:42 AM
Procedure is too big Frank Situmorang Excel Worksheet Functions 2 May 2nd 07 05:06 AM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM


All times are GMT +1. The time now is 02:13 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"