+ Reply to Thread
Results 1 to 4 of 4

Entering input and clicking buttons during loop

  1. #1
    Registered User
    Join Date
    03-22-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    11

    Entering input and clicking buttons during loop

    Hi guys,

    I'm new here and am fairly new to VBA. I have a problem and I don’t know how to solve it in VBA. I have spent some time thinking about this and have so far not got any help on the net.

    I am basically creating a questionnaire style program where the user gets asked 50 questions, one by one and they input their answer and press another button (submit button). They initially press a start button to start the questionnaire.

    So far, I have created a range of questions and it fills one row where the questions are entered. In intend to use a for loop to go though all 50 questions.

    Now this is where I’m stuck. I have a submit button and after each question is displayed, I want the user to enter their answer and then click the submit button to then continue to the next question.

    However, I can’t think of how to do this.

    1. Firstly, how can I loop through the questions and yet allow the user to input their answers after each iteration?
    2. Also can I even click the submit button during the loop phase? I.e. when already running.

    Here is the for loop I have:

    Please Login or Register  to view this content.
    Any help on this is much appreciated. I’m guessing I need some of Boolean for when the button is pressed but don’t know how to incorporate it into my code. I also want a clear button so that the user can reset their answer if they mess it up. But I’m hoping this solution will help me with that.

    Thanks,

    FJ
    Last edited by FlyinJack; 03-23-2009 at 01:49 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Entering input and clicking buttons during loop

    Welcome to the forum.

    Maybe like this:
    Please Login or Register  to view this content.
    Last edited by shg; 03-22-2009 at 07:48 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-22-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Entering input and clicking buttons during loop

    Hey shg,

    Thanks that helped immensely. I would never have thought of doing it like that (i.e. no loop method). My program is now working and I just have some enhancements to make (holes to correct).

    Thanks again for your great help. I’ve learned a lot!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Entering input and clicking buttons during loop

    You’re welcome. Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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