Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Read Large Array without writing in the worksheet | Excel Programming | |||
Putting contents of an Array into a Cell | Excel Programming | |||
Fast export large 2-dim array to worksheet | Excel Programming | |||
Reading Super Large Ranges from Worksheet into Array | Excel Programming | |||
Putting Array Formula into each Cell in a Selection (that doesn'ttake eons!) | Excel Programming |