View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Efficient Code to Copy a 1-D Array to a Worksheet Column

If I were doing this in VBA I would try both ways with a timer to see
which performance hit was worse.


.... and if it didn't matter much, I'd use WorksheetFunction.Transpose,
because I'm basically lazy.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Jon Peltier" wrote in message
...
Choose your inefficiency:

(a) Invoke WorksheetFunction.Transpose(MyArray) [I don't know how you
would do it in C#; that's your problem]

(b) Create and populate a 2D array from the 1D array.

If I were doing this in VBA I would try both ways with a timer to see
which performance hit was worse.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"R.E." wrote in message
...
Correction on my typo: Copying the data from the 1D array into a 2D array
does work, but adds inefficiency due to the extra copy step. I'd like a
more
efficient way. My app is going to be slow enough for the large arrays I
have, without adding an extra copy step.