ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Put 1D array into column (https://www.excelbanter.com/excel-programming/364106-put-1d-array-into-column.html)

Charlie

Put 1D array into column
 
I can move a 2D array into a range, no problem. I can move a 1D array into
cells across a row, no problem. But is there a syntax that will allow me to
move a 1D array into cells down a row?

Charlie

Put 1D array into column
 
I mean "down a column?"

"Charlie" wrote:

I can move a 2D array into a range, no problem. I can move a 1D array into
cells across a row, no problem. But is there a syntax that will allow me to
move a 1D array into cells down a row?


Paul Mathews

Put 1D array into column
 
Range(BlahdyBlah).Value = Application.Worksheetfunction.Transpose(ArrayName)

"Charlie" wrote:

I can move a 2D array into a range, no problem. I can move a 1D array into
cells across a row, no problem. But is there a syntax that will allow me to
move a 1D array into cells down a row?


Charlie

Put 1D array into column
 
That's the ticket! It converts the 1D array to 2D in the column direction,
e.g.

Dim a(3) '(Base 1)
a = Application.WorksheetFunction.Transpose(a)

"a" becomes a(1,1), a(2,1), a(3,1)

very useful! Thanks.

"Paul Mathews" wrote:

Range(BlahdyBlah).Value = Application.Worksheetfunction.Transpose(ArrayName)

"Charlie" wrote:

I can move a 2D array into a range, no problem. I can move a 1D array into
cells across a row, no problem. But is there a syntax that will allow me to
move a 1D array into cells down a row?


Alan Beban

Put 1D array into column
 
Charlie wrote:
That's the ticket! It converts the 1D array to 2D in the column direction,
e.g.

Dim a(3) '(Base 1)
a = Application.WorksheetFunction.Transpose(a)

"a" becomes a(1,1), a(2,1), a(3,1)

very useful! Thanks.


Same result for Dim a(2) '(Base 0)

Alan Beban


All times are GMT +1. The time now is 10:21 AM.

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