+ Reply to Thread
Results 1 to 5 of 5

Validate Listbox Entry

  1. #1
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Validate Listbox Entry

    Hi

    I am trying to validate the fact that a listbox has been populated but nothing seems to work unless the entry in the listbox is first selected.

    I have tried listcount, value, listindex but none seem to work unless any entry is first selected.

    If there a way of simply checking whether the listbox is not empty?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Validate Listbox Entry

    Hello AndyE,

    Can you post either the code or the workbook? That will answer at lot of questions.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    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.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Validate Listbox Entry

    Sample attached
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Validate Listbox Entry

    Hello AndyE,

    When a ListBox is updated through code, no events are triggered. An object must have the focus for events to fire. You need to make the label visible when you check for the item selected by the user in ListBox1.

    Here is the updated code for the UserForm.
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 03-08-2015 at 04:24 PM.

  5. #5
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Validate Listbox Entry

    Brilliant. Thank you very much.

+ 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. Validate that entry in one cell matches an entry in another range of cells
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2014, 03:57 PM
  2. [SOLVED] VBA to validate entry?
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-25-2014, 11:46 AM
  3. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  4. [SOLVED] MsgBox to validate an entry
    By TimN in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2006, 04:15 PM
  5. Validate Combobox entry
    By MBlake in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2005, 04: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