Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6623681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:33:41+00:00 2026-05-25T21:33:41+00:00

I created a trivia game using visual basic for applications (Excel) that chooses questions

  • 0

I created a trivia game using visual basic for applications (Excel) that chooses questions by going through a case statement where the cases are numbers. I have the program randomly select a number from 1 to the max amount of questions there are. Using this method, the game repeats questions.

Is there a way to make something that generates numbers randomly (different results every time) and doesn’t repeat a number more than once? And after it’s gone through all the numbers it needs to execute a certain code. (I’ll put in code that ends the game and displays the number of questions they got right and got wrong)

I thought of a few different ways to do this, however I couldn’t even begin to think of what the syntax might be.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:33:41+00:00Added an answer on May 25, 2026 at 9:33 pm

    Sounds like you need an Array Shuffler!

    Check out the below link –
    http://www.cpearson.com/excel/ShuffleArray.aspx

    Function ShuffleArray(InArray() As Variant) As Variant()
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' ShuffleArray
    ' This function returns the values of InArray in random order. The original
    ' InArray is not modified.
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Dim N As Long
        Dim Temp As Variant
        Dim J As Long
        Dim Arr() As Variant
    
    
        Randomize
        L = UBound(InArray) - LBound(InArray) + 1
        ReDim Arr(LBound(InArray) To UBound(InArray))
        For N = LBound(InArray) To UBound(InArray)
            Arr(N) = InArray(N)
        Next N
        For N = LBound(InArray) To UBound(InArray)
            J = CLng(((UBound(InArray) - N) * Rnd) + N)
            Temp = InArray(N)
            InArray(N) = InArray(J)
            InArray(J) = Temp
        Next N
        ShuffleArray = Arr
    End Function
    
    Sub ShuffleArrayInPlace(InArray() As Variant)
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' ShuffleArrayInPlace
    ' This shuffles InArray to random order, randomized in place.
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Dim N As Long
        Dim Temp As Variant
        Dim J As Long
    
        Randomize
        For N = LBound(InArray) To UBound(InArray)
            J = CLng(((UBound(InArray) - N) * Rnd) + N)
            If N <> J Then
                Temp = InArray(N)
                InArray(N) = InArray(J)
                InArray(J) = Temp
            End If
        Next N
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’ve created a little weekly trivia game for my website. Basically its five questions,
I have created a custom dialog for Visual Studio Setup Project using the steps
I have a created a user control that is hopefully going to be used
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user
I created a few mediawiki custom tags, using the guide found here http://www.mediawiki.org/wiki/Manual:Tag_extensions I
I created a simple .NET windows application in Visual Studio 2005 and on just
I'm using Entity Framework in Visual Studio 2010 Beta 2 (.NET framework 4.0 Beta
I have a trivial little game I wrote in javascript that creates a wave
I am created pre-generated views for my EDMX using VS 2008, .NET 3.5 and
I have created an extension for mediawiki that works in all major browsers other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.