+ Reply to Thread
Results 1 to 9 of 9

Looping 2 msgboxes

  1. #1
    Registered User
    Join Date
    12-18-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    30

    Looping 2 msgboxes

    I am trying to loop 2 msgbox's by asking if you would like to try again. I assumed this was a simple task but I cannot figure out to restart the process again. Does anyone have a solution for this?



    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 11-10-2016 at 02:10 PM. Reason: code tags

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Looping 2 msgboxes

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you only have a few posts. --6StringJazzer

    I think this will get you there but it would be helpful if you posted all the code instead of just this snippet.
    Please Login or Register  to view this content.
    Note that once you get to here, you might not have valid job files, if they gave a bad job number and said "No" for try again. That was also a problem in your original code.

    You can enhance this if you can determine all the valid job numbers in advance, then give the user a list to choose from instead of having them type something in that might not exist.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Looping 2 msgboxes

    Please review the Forum Rules. Specifically Rule No. 3 about using code tags when posting code.

    http://www.excelforum.com/forum-rule...rum-rules.html

    Try using Goto to solve your problem:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Looping 2 msgboxes

    jobNumber = MsgBox("Enter the job number. Be sure to have the proper file downloaded", "Job number", "Enter job number here", Type:=1)
    Can't enter a value in a MsgBox.

    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 11-10-2016 at 02:18 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Registered User
    Join Date
    12-18-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    30

    Re: Looping 2 msgboxes

    basically it is the beginning of a service report for my company. Our dispatcher emails out an excel sheet with all of the service call information and calls it a specific job number. This sheet will eventually import all of the information into a template I made. The job number will always be different. Here is all of the code I made so far. I found a way to make it work by starting the sub over.





    Please Login or Register  to view this content.
    Last edited by Maxwelll; 11-11-2016 at 01:14 PM.

  6. #6
    Registered User
    Join Date
    12-18-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    30

    Re: Looping 2 msgboxes

    Sorry I knew about the msgbox. I was trying something different right before I started the post. This last one was my origional

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Looping 2 msgboxes

    Maxwelll, I already notified you about code tags above. Now I have to insist that you edit post #5 to conform to the rules.

    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.

  8. #8
    Registered User
    Join Date
    12-18-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    30

    Re: Looping 2 msgboxes

    My apologies. I did not know about the rule and did not notice your post.

    Issue resolved

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Looping 2 msgboxes

    Did you try the code in post #4 ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Using VBA Wksht Change Codes to Show MsgBoxes
    By SheavF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2015, 10:21 AM
  2. help with if and looping
    By uniks in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-25-2015, 01:59 AM
  3. [SOLVED] Nesting Conditions and using Yes/No MsgBoxes to execute a code
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2014, 01:26 PM
  4. Looping help!
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2014, 07:41 PM
  5. Suppressing msgboxes appearing during loop
    By msixdatateam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2014, 01:13 PM
  6. Do Until Looping (not looping through all other columns)
    By orle8050 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2013, 10:37 AM
  7. Need to suppress MsgBoxes
    By bconner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2009, 02:12 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