Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
[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
Posted to microsoft.public.excel.programming
|
|||
|
|||
[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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array formula: how to join 2 ranges together to form one array? | Excel Worksheet Functions | |||
Named Ranges in Array Formulas | Excel Worksheet Functions | |||
reading an arbitrary selection into a 1D array | Excel Programming | |||
Reading formatted cell values into an array | Excel Programming | |||
Reading a cell into an array | Excel Programming |