+ Reply to Thread
Results 1 to 3 of 3

Using VBA code to randomly generate words without repetition

  1. #1
    Registered User
    Join Date
    11-06-2014
    Location
    California
    MS-Off Ver
    2013
    Posts
    2

    Using VBA code to randomly generate words without repetition

    I am working with vba to create a quiz term generator. I have a column of words in cells B5 to B160. I am trying to make a code that will randomly generate a word without any of them being repeated. I am little stumped as to where to start. We are told we must use Durstenfeld's algorithm to do this. Any help would be greatly appreciated!

    Thanks!

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Using VBA code to randomly generate words without repetition

    Please Login or Register  to view this content.
    Will reorder the list using Durstenfeld algorithm

  3. #3
    Registered User
    Join Date
    11-06-2014
    Location
    California
    MS-Off Ver
    2013
    Posts
    2

    Re: Using VBA code to randomly generate words without repetition

    Hey thanks for the help pjwhitfield!

    I am also having trouble making a code that will display these terms via a user form. What I am trying to do is generate a flash card quiz that displays these terms randomly once the 'start' button is pressed. I am also trying to create a code for the 'reset' button that resets the entire quiz. We are told to use a static integer, but I'm not sure how this code works or how to combine it with the Durstenfeld algorithm. The code that we are supposed to use looks something like this:

    Sub GetItem(Optional reset as Boolean)
    Static m as integer
    If reset then m = 0
    UserForm1.Label1 = m
    End Sub

    Where we want to display the mth element of the randomized vector.

    Any ideas on how to incorporate this?

    I know this is a lot, but if you could help me incorporate this code or point me in the right direction, that'd be great!

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Simple macro to randomly generate 0 or 1
    By mattdaviddesign in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2013, 08:32 PM
  2. Replies: 15
    Last Post: 11-28-2012, 03:23 PM
  3. [SOLVED] Generate column of 1's and 0's randomly
    By Ian Engelbrecht in forum Excel General
    Replies: 6
    Last Post: 04-01-2006, 09:52 AM
  4. I WOULD LIKE TO RANDOMLY GENERATE FROM LIST I CREATE ON SAME PAGE
    By totalmaker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2005, 11:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1