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: 18
Default Putting large array into a worksheet

I have a program creating an array using Chip Pearsons excellent
UniqueRandomLongs function. I found some other code in here that will
put it in a worksheet in 1 column. This method seems to have a max of
256 items (# of columns in excel I suppose). I would like to be able
to do more than that if possible. Could anyone help me out? The
current code Im using for placement is:

Dim Res As Variant
Dim Min As Long
Dim Max As Long
Dim N As Long

'''''''''''''''''''''''''''''
' Get N non-duplicated Longs
' each of which is between
' 1 and Max.
'''''''''''''''''''''''''''''
Min = 1
Max = reccount
N = recpct

Res = UniqueRandomLongs(Minimum:=Min, Maximum:=Max, Number:=N)

If IsArrayAllocated(Res) = False Then
Debug.Print "Error from UniqueRandomLongs."
Else
arr = Res
m = UBound(arr, 1) - LBound(arr, 1) + 1
Set targetrng = Range("A2").Resize(, m)
targetrng.Value = arr
Range("A2:A" & m).Value = Application.Transpose(arr)

End If
 
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
Read Large Array without writing in the worksheet Daniel Excel Programming 4 October 12th 07 09:41 PM
Putting contents of an Array into a Cell John Pierce Excel Programming 7 September 25th 06 03:00 PM
Fast export large 2-dim array to worksheet aafraga Excel Programming 3 February 8th 06 02:59 PM
Reading Super Large Ranges from Worksheet into Array Marston Excel Programming 18 August 12th 04 08:14 PM
Putting Array Formula into each Cell in a Selection (that doesn'ttake eons!) Dave Peterson[_3_] Excel Programming 1 April 1st 04 09:34 AM


All times are GMT +1. The time now is 01:28 AM.

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

About Us

"It's about Microsoft Excel"