Randomize 3000 integers

Posted on 2006-05-27
Last Modified: 2010-04-30
How do I randomize 3000 integers in a vertical array?
Question by:raigam

    Author Comment

    I can not find any answers to it. Why do you say , "Moved"? Please help.
    LVL 6

    Expert Comment

    Could you describe your question more clearly so that people can understand you?

    Please try to make an example for your question.

    LVL 29

    Accepted Solution


    You originally asked your question in the VB Databases area, but your question had nothing to do with databases, therefore I moved the question to the general VB area.

    In regard to your question. You should create an array of 3000 integer elements and then populate it with random numbers:

    Sub RandomNum()
    Dim aIntegers(2999) as Integer
    Dim intCount As Integer
    Dim intMax As Integer, intMin As Integer

    intMax = 32767
    intMin = 1
    Randomize Timer
    For intCount = 0 to 2999
        aIntegers(intCount) = Int((intMax - intMin + 1) * Rnd(1) + intMin)
    End Sub


    Author Comment

    Hi Leon,

    I am sorry I could not reply to your response earlier. I have been on a new assignment, and just got the opportunity to go through my emaill.

    Many thanks for your excellent solution!

    Best Regards,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now