Hi,
I am trying to produce a sixteen element array from cells in a 4 by 4
section eg (A1:D4) of a larger 16 by 16 grid eg (A1:P16)
If I write
Dim rng1 As Range, rng2 As Range, rng3 As Range
Dim xxx As Variant, yyy As Variant, zzz As Variant
With Worksheets("Sheet1")
Set rng1 = .Range("A1:P1")
Set rng2 = .Range("A1:A16")
Set rng3 = .Range("A1:D1, A2:D2, A3:D3, A4:D4")
End With
xxx = rng1.Value
yyy = rng2.Value
zzz = rng3.Value
then both xxx and yyy produce 16 element arrays. However, zzz produces
only a 4 element array ie the first row.
I can confirm that rng3 describes 16 cells by adding rng3.Select to the
code. The correct area is highlighted.
What else do I have to add to the code?
Thanks in advance,
Ken Rock
Bookmarks