+ Reply to Thread
Results 1 to 4 of 4

Message Box to warn if data is missing

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Message Box to warn if data is missing

    Hello,

    I have created a useform to collect some information in excel. There is a command button at the bottom which then creates and event and copies the data into the associated spreadsheet.
    There is one listbox and one text box in the form. I would like some code for a message box to appear if either the list or text box is empty.
    For example, if the listbox is empty and the user selects the command button, then a message box appears with the message "please fill in listbox"
    if the textbox is empty when the command button is selected, the message appears saying "please fill in textbox"
    If both the list box and the text box are complete, then when the command button is clicked the data in the userform will be transferred to the excel spreadsheet.

    I have all the other code written already (including how to copy the values into the spreadsheet for the event), I am just struggling with message boxes.

    I thank you in advance for your assistance

    T15K

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Message Box to warn if data is missing

    Hi, T15K,

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Message Box to warn if data is missing

    @ HaHoBe,

    Hello Holger,

    As always, well done!

    I would not have thought of using "Trim". I like it.

    Cheers
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    07-10-2012
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Message Box to warn if data is missing

    Outstanding. Thank you very much Hahobe.

+ 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] MEssage to confirm missing data in userform
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2013, 09:06 AM
  2. How to use IFERROR to display certain message, depending on missing value?
    By itsm3json in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2013, 12:44 AM
  3. Warn if duplicate data is present
    By pprseller in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2009, 07:22 PM
  4. Message Box For Missing Data
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2009, 07:43 PM
  5. Warn if data is in range
    By Pat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2005, 12:06 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