Consulting

Results 1 to 4 of 4

Thread: ReTry

  1. #1

    ReTry

    Hello,


    I have been working on this for awhile and still not coming up with what i need.
    Every leads will be appreciated.


    ***
    Write a macro that does the following actions:
    The macro asks the user to make the sum of two numbers while the answer is not correct.
    When the user finds the right answer, the macro will write in cell A1 the number of tries necessary to find the right answer.
    You can write these two numbers directly in the code of the macro.
    ****


    Thank You.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Your first post is about a homework problem?

    See the faq: http://www.vbaexpress.com/forum/faq....q_hom_faq_item

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    A homework assignment.

    You will need at least one Variable to hold the number of attempts.
    You can use two more variables to hold the numbers.
    Then you can use an InputBox to ask the User the question.

    It will probably be easier to understand the code if you use a fourth variable to hold the answer

    You will need to use a loop such as
    Do While Not Answer = Sum(Var2, Var3)
    Answer = CLng(InputBox blah blah blah)
    Var1 = Var1 + 1
    Loop
    Range("A1") = Var1
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    Quote Originally Posted by kme.amoah View Post
    Hello,


    I have been working on this for awhile and still not coming up with what i need.
    Every leads will be appreciated.
    Show us what you have so far
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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