Results 1 to 8 of 8

Developing a Quiz Application using VB and Excel - Unable to halt the loop to enable Input

Threaded View

  1. #1
    Registered User
    Join Date
    09-09-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    4

    Developing a Quiz Application using VB and Excel - Unable to halt the loop to enable Input

    Hi!
    This is the first time that I am actually posting a Thread (after spending a sleepless night trying to debug). Hope I would find a solution here.

    I am stuck up in this code.

    I am using an excel file with a Question Bank and am displaying the Question in a TextBox on a user form. 4 Possible Answers are displayed using Option Button Captions and am looping thru the same code to display all the questions one by one.

    My only problem is that I am unable to make the program wait for user to click on the right option button and submit his reply (command button - with a command_click event captured).

    When the question with 4 Options is displayed I want the program to give the user 30 secs (should be displayed in a timer) to click on any of the options and then click on Submit command. The program simply loops thru the code.

    Any help would be highly appreciated.


    Private Sub LoadQuiz()
    Mkr = ""
    Dim c As Long
    Dim rng As Range
    Sheets("Question").Select
    x = Cells(Rows.Count, "A").End(xlUp).Row - 1
    y = 8
    r = 2
    Do While r < x
    TextBox1.Value = "Question " & r - 1 & " of " & x
    TextBox2.Value = Cells(r, 2)
    OptionA.Caption = Cells(r, 4)
    OptionB.Caption = Cells(r, 5)
    OptionC.Caption = Cells(r, 6)
    OptionD.Caption = Cells(r, 7)
    Me.Show
    Application.Wait (Now + TimeValue("00:00:30"))
    Loop
    End Sub


    Last edited by Fotis1991; 11-25-2014 at 03:31 AM. Reason: pLS USE CODE TAGS AROUND YOUR CODES!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Halt macro - wait for user input
    By The Skipper in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2013, 03:26 PM
  2. Unable to export image to excel from web application
    By just swathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-24-2011, 09:47 AM
  3. Excel Application Unable to Connect the High available (Mirroring) database
    By satish0680 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2010, 07:44 PM
  4. Input parameters to an excel Application
    By eitancoh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2007, 06:35 PM
  5. Developing in 2000 for 2002 application; problems?
    By Sandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2005, 01:05 AM

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