Pasting a portion of an array

W

ww

Hello

i would like to paste an array to my spreadsheet but i only want to
paste the right most column to the sheet. i simply cannot rememeber
how to resize it. I think i have the left side of the equation
correct but....

wbk.Application.Range("drop_here").Resize(UBound(vTemplate, 1),
1).Value = vTemp

Thank you in advance.

W
 
A

Alan Beban

ww said:
Hello

i would like to paste an array to my spreadsheet but i only want to
paste the right most column to the sheet. i simply cannot rememeber
how to resize it. I think i have the left side of the equation
correct but....

wbk.Application.Range("drop_here").Resize(UBound(vTemplate, 1),
1).Value = vTemp

Thank you in advance.

W
If vTemp has fewer elements than 5461 or you're working in a version of
Excel later than xl2000, change vTemp to Application.Index(vTemp,0,1).

Alan Beban
 
A

Alan Beban

Alan said:
If vTemp has fewer elements than 5461 or you're working in a version of
Excel later than xl2000, change vTemp to Application.Index(vTemp,0,1).

Alan Beban
Whoops! I gave you code for the leftmost column. For the rightmost
substitute

Application.Index(vTemp, 0, UBound(vTemp, 2) - LBound(vTemp, 2) + 1)

Sorry,
Alan Beban
 
Top