+ Reply to Thread
Results 1 to 3 of 3

problem with Check for ListBox required field

  1. #1
    Registered User
    Join Date
    11-07-2017
    Location
    Austin, TX
    MS-Off Ver
    2010
    Posts
    22

    Exclamation problem with Check for ListBox required field

    Hello,

    All of sudden, Excel VBA is not finding the ListBox when I do the following search (it does find the ComboBox):
    Dim Ctrl As MSForms.Control
    If Ctrl.Tag = "REQUIRED" Then
    Select Case TypeName(Ctrl)
    Case "ComboBox", "ListBox"
    If Ctrl.ListIndex = -1 Then

    However, if I do it this way, it finds the ListBox, but marks it as empty (even though it's not).
    Case "TextBox", "ListBox"
    If Ctrl.Text = "" Then

    How can I fix this so it finds only the empty ListBox?

    Thanks very much for your help.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: problem with Check for ListBox required field

    This works for me.
    Please Login or Register  to view this content.
    TIP: Paste code between code tags for structure and required by forum rules. Click the # icon on the reply toolbar to insert tags.

  3. #3
    Registered User
    Join Date
    11-07-2017
    Location
    Austin, TX
    MS-Off Ver
    2010
    Posts
    22

    Re: problem with Check for ListBox required field

    Hi Kenneth,

    This sub finds everything *except* the ListBoxes. Help!

+ 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. How to check Required field Not Empty with "Tag = Optional"
    By shedragon713 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-11-2017, 07:21 PM
  2. Check if a Field is used in an other field for a Formula?
    By Fabsi 91 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-17-2014, 10:26 AM
  3. Replies: 1
    Last Post: 09-25-2014, 04:12 PM
  4. Check each row, if each proceeding row matches, take data and put in required field t
    By mattsmithnl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2011, 03:27 PM
  5. Listbox data required
    By kuzniaj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 01:34 PM
  6. Required Field
    By tiab86 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2006, 05:00 PM
  7. Required Field
    By tiab86 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-06-2006, 04:33 PM

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