Ragnar1211
Well-known Member
- Joined
- Jul 10, 2008
- Messages
- 572
I am trying to learn something about using arrays with excel ranges.
The following code works fine, it takes the data in the range and feeds it into an array then it puts that data somewhere else:
However, I cannot figure out how to put a part of the array into a range without looping:
Question - how do you get the second column of an array without looping through it?
[/code]
The following code works fine, it takes the data in the range and feeds it into an array then it puts that data somewhere else:
Code:
sub array2test()
dim ar1
ar1 = range("a2:b10")
range("L2:M10") = ar1
end sub
However, I cannot figure out how to put a part of the array into a range without looping:
Code:
sub array2test()
dim ar1
ar1 = range("a2:b10")
range("M2:M10") = ar1 '<-- I only want the second column of ar1, but don't know how to get it
end sub
Question - how do you get the second column of an array without looping through it?
[/code]