Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default [excel 97 vba ] Reading ranges into an array

Hello

Does anyone know if there is an elegant way to do the
following

read in a range from excel
copy values into an array
....
copy array to an output range

If some knows a good tutorial on arrays and range
manipulation that would be excellent.

So far I have to do a lot of looping and can't cannot help
feeling that I have reinvented the wheel so to speak.
Perhaps this is the only option in Excel 97..

thanks

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default [excel 97 vba ] Reading ranges into an array

Sub doArrays()
Dim varr As Variant
Dim numrows As Long
Dim numcols As Long
numrows = 3
numcols = 2
varr = Worksheets("Sheet1").Range("B9"). _
Resize(numrows, numcols).Value
For i = LBound(varr, 1) To UBound(varr, 1)
For j = LBound(varr, 2) To UBound(varr, 2)
MsgBox "varr(" & i & ", " & j & ")= " & varr(i, j)
Next
Next
Worksheets("Sheet3").Range("Z11"). _
Resize(numrows, numcols).Value = varr
End Sub


--
Regards,
Tom Ogilvy

"steve" wrote in message
...
Hello

Does anyone know if there is an elegant way to do the
following

read in a range from excel
copy values into an array
...
copy array to an output range

If some knows a good tutorial on arrays and range
manipulation that would be excellent.

So far I have to do a lot of looping and can't cannot help
feeling that I have reinvented the wheel so to speak.
Perhaps this is the only option in Excel 97..

thanks

Steve



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
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Named Ranges in Array Formulas jfitzpat Excel Worksheet Functions 2 May 20th 08 11:34 PM
reading an arbitrary selection into a 1D array Jamie Martin[_2_] Excel Programming 5 September 30th 03 05:25 PM
Reading formatted cell values into an array Tom Ogilvy Excel Programming 0 September 19th 03 06:32 PM
Reading a cell into an array Tick-Tock Excel Programming 2 September 11th 03 07:33 PM


All times are GMT +1. The time now is 03:35 PM.

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

About Us

"It's about Microsoft Excel"