+ Reply to Thread
Results 1 to 10 of 10

Display Pop Up Message while a Subroutine Executes and close when Exit Sub

  1. #1
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    I'm looking for a simple way to display a pop up message while a lengthy subroutine executes and then closes when exit sub?

    Please Login or Register  to view this content.
    Thanks for the help.

    Jim

  2. #2
    Forum Contributor
    Join Date
    05-25-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    194

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Hi Jim,

    Msgbox's are always displayed as modal (e.g. they hault code and wait for user input before proceeding). The easiest way to get around this would probably be to create a custom userform, have it display the message you want, and call the userform using vbmodeless (e.g. non-modal). This allows all other functions to continue while being displayed.

    If you provide a sample workbook and what messages you want to appear, I could create a userform for you and show you the correct syntax to call/close it.

    Hope you find this helpful,
    Nick

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Hi Jim,

    The best example for this are progress meters (bars). They show the user how much progress has happened, without stopping the code from continuing to run. In the Water Cooler there is a thread that I started dedicated to this. In it you will find many examples.

    Let us know if you need any further assistance.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Thanks Aousetta. Do you have a link to the Water Cooler and the thread you mention?
    Jim

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub


  6. #6
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Thanks Abousetta. I'm sure I will find something in here!

  7. #7
    Forum Contributor
    Join Date
    06-09-2011
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    194

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Hi,

    it is pretty simple if you use Userforms. To give it a kick-start I have included a Userform into the attached worksheet.

    Hope this is what you needed

    Regards

    Theo
    Attached Files Attached Files
    Remember To Do the Following....
    1. Upload sample files
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

  8. #8
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Thanks Fettertiger. I'll give it a try as well.

  9. #9
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    Thanks Medpack. Lot's of good advice.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Display Pop Up Message while a Subroutine Executes and close when Exit Sub

    The first thing to do before any of this is to check that your code is as fast as possible - avoid selecting, only work on specific data not whole columns, avoid looping etc.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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