View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Six columns randon no.'s no dupes



For i = 1 To 6


MsgBox Small & " " & Big


NumberOfRandoms = Big




' Load up an array with all the values for the range of random numbers


ReDim Numbers(1 To Big - Small + 1)


For X = Small To Big


Index = Index + 1


Numbers(Index) = X




Next




change the above to:



For i = 1 To 6

MsgBox Small & " " & Big

NumberOfRandoms = Big - Small + 1



' Load up an array with all the values for the range of random numbers

For X = Small To Big

Numbers(Index) = X

Index = Index + 1

Next



So Numbers has always 20 items decare it:

dim Numbers(19) As Long





Regards

Claus B.



Hi Claus,

Thanks for the help.

I ran the first code and it seems to work well.

I made the first change as you suggested and the code run just as well.

I can't figure out where the last change is to go in the code. What it is supposed to replace I don't see anywhere in the code.

I am using =SUM(...) at the bottom of each column to check for dupes (improper sum for that column) and running it about 50 times has me convinced it is working well without the last change.

Seems rock solid to me. Is the last change necessary?

Howard