ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving an array (https://www.excelbanter.com/excel-programming/311705-saving-array.html)

Ken McLennan[_3_]

Saving an array
 
G'day there again,

I've just found a smallish problem that I can't figure out. I'm
trying to save an array of strings to a range.

I've got the correct data loaded into the array, and I'm using
this statement to save it:

Worksheets("Data").Range("SavedShifts").Value = arrCtrl

"SavedShifts" *IS* a named range on the "Data" sheet. However all
I get is the data from arrCtrl(0) saved into each cell.

A debug.print statement shows me that the data in arrCtrl is
correct, but it's only saving a single value across the range.

I'm sure it's something simple, but it escapes me completely.

Any ideas, anyone?

Thanks once more
Ken McLennan
Qld, Australia

Bernie Deitrick

Saving an array
 
Ken,

Instead of

...... = arrCtrl

use

...... = Application.Transpose(arrCtrl)

HTH,
Bernie
MS Excel MVP

"Ken McLennan" wrote in message
.. .
G'day there again,

I've just found a smallish problem that I can't figure out. I'm
trying to save an array of strings to a range.

I've got the correct data loaded into the array, and I'm using
this statement to save it:

Worksheets("Data").Range("SavedShifts").Value = arrCtrl

"SavedShifts" *IS* a named range on the "Data" sheet. However all
I get is the data from arrCtrl(0) saved into each cell.

A debug.print statement shows me that the data in arrCtrl is
correct, but it's only saving a single value across the range.

I'm sure it's something simple, but it escapes me completely.

Any ideas, anyone?

Thanks once more
Ken McLennan
Qld, Australia




Ken McLennan[_3_]

Saving an array
 
G'day there Bernie,

Instead of

..... = arrCtrl

use

..... = Application.Transpose(arrCtrl)


Thanks for that. I had to use
Application.Worksheetfunctions.Transpose, but it worked like a charm.

Thanks once again,
Ken McLennan
Qld, Australia


All times are GMT +1. The time now is 08:55 PM.

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