+ Reply to Thread
Results 1 to 8 of 8

MEssage to confirm missing data in userform

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    106

    MEssage to confirm missing data in userform

    Hi I have a userform with listboxes, options buttons and textboxes.

    I have the following code to check a value is entered in each box and have a message populate if it doesn't. But what I really want is a message that populates and states Information is missing from" " and lists what data is missing.

    FOr example if they forgot to enter there name and age it would say "Data is missing from: FIrst Name
    Age"

    Please Login or Register  to view this content.
    ANy ideas how to achieve this would be great.

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: MEssage to confirm missing data in userform

    something like ?

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Forum Contributor
    Join Date
    12-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: MEssage to confirm missing data in userform

    HI, I follow the logic but cannot get it to work in mine.
    In the last bit of code you ref vbCrLf. WHere is that from?

    SOrry for being useless.

    DO I need to define what the initial message would be = Errortext

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: MEssage to confirm missing data in userform

    Hi Chris,

    The vbcrlf is a constant used to split the error message text shown by the MsgBox instruction over two lines. Should be no problem to use. There is no need to define an initial error message.

    You say you cannot get it to work. What is the problem or error message?

  5. #5
    Forum Contributor
    Join Date
    12-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: MEssage to confirm missing data in userform

    Hi. Getting closer now.

    I have got your code working now but it has caused another issue.

    Basically when it detects an error now it is closing and reopening the userform. I think this is due to the preceding code. ANy tips would be gratefully received:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: MEssage to confirm missing data in userform

    Ok, I did not expect you to merge the code in the way you have done

    Replace

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.
    Replace

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-14-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: MEssage to confirm missing data in userform

    Thank you so much Ollie. U are a star.

    Works perfectly and you also solved another query I had on another thread. Will mark both as solved.

    CHeers

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: MEssage to confirm missing data in userform

    You are welcome. Please remember to click the "*" if you are happy with my contribution

+ 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. Add message box to confirm run macro
    By Anolan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2020, 11:51 AM
  2. Confirm Message Before Deleting Rows
    By mackypogi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2015, 10:00 AM
  3. [SOLVED] Programming a confirm overwrite message box
    By duality1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2012, 01:12 PM
  4. [SOLVED] Confirm Delete Message Disable
    By RiosPapa in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-07-2005, 05:05 PM
  5. Message box to confirm action
    By CRayF in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2005, 08: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