ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting a portion of an array (https://www.excelbanter.com/excel-programming/309079-pasting-portion-array.html)

ww

Pasting a portion of an array
 
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(v Template, 1),
1).Value = vTemp

Thank you in advance.

W

Alan Beban[_2_]

Pasting a portion of an array
 
ww wrote:

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(v Template, 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


Alan Beban[_2_]

Pasting a portion of an array
 
Alan Beban wrote:

ww wrote:

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(v Template, 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

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



All times are GMT +1. The time now is 08:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com