Closed Thread
Results 1 to 5 of 5

Using a Do...Loop While structure, write the code that repeatedly prompts

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    united states
    MS-Off Ver
    Excel 2010
    Posts
    64

    Using a Do...Loop While structure, write the code that repeatedly prompts

    I have to do this
    Using a Do...Loop While structure, write the code that repeatedly prompts the user using an InputBox for a number, and continues to prompt the user until a valid positive number is entered.

    Would someone check my answer? I can't figure why this is not working properly? I don't even know if I am doing what this question is asking me to do?! I just started Visual Basic 3 weeks ago

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim stringMagic As String
    Do
    stringMagic = InputBox("Enter my age", "Guess")
    Loop While stringMagic = "51"
    End Sub
    End Class

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: Using a Do...Loop While structure, write the code that repeatedly prompts

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: Using a Do...Loop While structure, write the code that repeatedly prompts

    Also, is this http://www.excelforum.com/excel-prog...th-number.html

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: Using a Do...Loop While structure, write the code that repeatedly prompts

    1Melina, please read Forum rules or I'll start to give infractions.
    You have few threads closed because of duplicate posting and that's nobody interest.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,406

    Re: Using a Do...Loop While structure, write the code that repeatedly prompts

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.
    http://www.excelforum.com/excel-prog...y-prompts.html

    Thread Closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to run VBA code repeatedly?
    By Sid108 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-14-2015, 12:49 PM
  2. How to write vb code for selecting pivot items in a loop??
    By luckyali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2014, 06:00 AM
  3. [SOLVED] How to write a code within a loop to copy and paste rows on to another Sheet
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-24-2014, 08:40 PM
  4. [SOLVED] doing a loop repeatedly only for an specific value
    By omid020 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2013, 06:34 AM
  5. Cannot properly structure Loop
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2009, 11:14 PM
  6. Best way to code a repeatedly used array?
    By ajm218 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2008, 03:38 PM
  7. [SOLVED] How do I write an Excel Macro to run Solver repeatedly?
    By DLowie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2005, 01:05 PM

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