Big Chemical Encyclopedia

Chemical substances, components, reactions, process design ...

Articles Figures Tables About

Equating a Worksheet Range To an Array Variable

This is much more convenient than the loop method, where two nested loops would be required to read or write a 2-D range. However, a problem arises when you use this method with a 1-D range, as described next. [Pg.285]

A 1-DIMENSIONAL ARRAY ASSIGNED TO A WORKSHEET RANGE CAN CAUSE PROBLEMS [Pg.286]

Arrays can cause some confusion when you write the array back to a worksheet by assigning the value of the array to a worksheet range. [Pg.286]

For X = 1 To 10 TestArray(x) = 10 + x Next Then writes the array elements to cells E1 E10. Range( E1 E10 ).Value = TestArray End Sub [Pg.286]

If you run the preceding Sub procedure, you will find that cells El through E10 will all contain 11, the first element of the array. However, if you write the array to a row of cells instead of a column, thus  [Pg.286]

Range( E1 N1 ).Value = TestArray each cell of the range will receive the correct array value. [Pg.286]


See other pages where Equating a Worksheet Range To an Array Variable is mentioned: [Pg.285]    [Pg.285]   


SEARCH



Array variable

Equation variables

Worksheets

© 2024 chempedia.info