+ Reply to Thread
Results 1 to 3 of 3

Message box help with loop

  1. #1
    Registered User
    Join Date
    11-25-2015
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    12

    Message box help with loop

    Hello,

    I have some code that compares part of a filename to a list in a column then moves the file to a new folder if they match. However I can't seem to get the message boxes right. I want ONE message box to display "Files archived!" when the loop is finished and ALL the files that match have been moved, but also a msg box to display "File not found" when a file that is in the list cannot be found in the folder. I can only seem to get a message box to display after every file is moved so..20+ message boxes, or one at the very end regardless if anything has been moved or not


    Here's (part) of my code:

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Message box help with loop

    Set a Counter... increment it when you move a file and if not 0 at the end then display the messagebox

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-25-2015
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    12

    Re: Message box help with loop

    This worked, thanks!

+ 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] VBA Form code using DO while Loop to print a message.
    By enjoi2p0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 02:34 AM
  2. [SOLVED] Error Message with For Loop
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2013, 04:22 PM
  3. [SOLVED] Loop through Column and return message box if criteria is met.
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2013, 10:47 AM
  4. [SOLVED] Message Box Loop Macro
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-19-2012, 12:31 PM
  5. Return a single message box within a loop.
    By aappmm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2012, 12:48 PM
  6. 'Loop without do' error message (code inside)
    By Jeroen1000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2009, 07:16 AM
  7. Error Message in Loop
    By Joe Fish in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2005, 08:40 PM
  8. Error message when using the Solver in a VBA macro loop
    By Mathieu Fournier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2005, 11:06 AM

Tags for this Thread

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