LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default pasting array output to sheet

my code generates output in an array of m by n dimensions (m rows and n
columns). Number of rows and columns depends on the input. now i want to
paste the result to sheet2 starting from cell B2. one of the way is as under:

For ctr15 = 1 To n
For ctr16 = 1 To m
Sheet2.Cells(1 + ctr16, 1 + ctr15).Value = FinalOutput(ctr16, ctr15)
Next ctr16
Next ctr15

This works fine, but the problem is it is too slow. excel paste the result
cell by cell and is very slow. Much faster code is when entire array is
pasted at a time. assuming 10 rows by 15 column output, code is:

Sheet2.Range("b2:p11") = FinalOutput

This also works. But problem is how to generalize the above code based on
different values of m and n, i.e. different rows and columns. I tried the
specifying just the corner left cell of the range, but that does not works
Sheet2.Range("b2") = FinalOutput
this just returns value on cell b2

please help
regards
pradip
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a List Output from a Horizontal Array Input Rob Excel Worksheet Functions 4 September 17th 09 05:40 PM
customise array formula output TUNGANA KURMA RAJU Excel Discussion (Misc queries) 0 October 25th 05 05:15 AM
UDF, Array function, vertical output Robin Hammond[_2_] Excel Programming 2 September 30th 04 05:23 AM
Add value to array based on if...then output in VBA Scott P Excel Programming 4 June 14th 04 11:10 AM
Help with 1 x 2 array output jomni[_3_] Excel Programming 3 April 2nd 04 03:49 PM


All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"