+ Reply to Thread
Results 1 to 5 of 5

ListBox value is Null

  1. #1
    Registered User
    Join Date
    05-07-2021
    Location
    Naples, Italy
    MS-Off Ver
    Office 2016
    Posts
    30

    ListBox value is Null

    Hi everyone!

    I hope you are well. I have a list box in my userform linked to a name range list. Usually the user scroll through the ListBox but does not actually select the item so, when the form transfer the data onto the sheet that cell remains empty.

    Is there a way to tell the ListBox to select the item displayed without clicking it? I have specified the "SelectSingle" behavior but it is still the same.


    Many thanks for your support!

  2. #2
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: ListBox value is Null

    Please Login or Register  to view this content.
    Messages have been translated from Dutch to English by means of google translate.

  3. #3
    Registered User
    Join Date
    05-07-2021
    Location
    Naples, Italy
    MS-Off Ver
    Office 2016
    Posts
    30

    Re: ListBox value is Null

    Sorry Vraag, I didn't get it ... I was thinking to use the KeyUp/KeyDown/KeyPress/Change private subs of the listbox for that, is it the correct approach?

  4. #4
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: ListBox value is Null

    You'd better post a sample file. See the yellow banner on how to do that.

  5. #5
    Registered User
    Join Date
    05-07-2021
    Location
    Naples, Italy
    MS-Off Ver
    Office 2016
    Posts
    30

    Re: ListBox value is Null

    Hi Vraag.

    I figured that out ... the listbox is as tall as a single line so when the user clicks on the arrows the item changes but does not actually get selected. I ended up adding this piece of code, in case the user scroll through using the Up/Down arrow keys, to increase the possibility to select an item in the list.

    Please Login or Register  to view this content.
    This is how the listbox normally behaves; the alternative would be using a dropdown list (combobox) where you have to actually select the item to close the dropdown list.


    Many 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. [USERFORM] Check if the first item in listbox is null.
    By thebeastslayer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2020, 03:19 AM
  2. [SOLVED] How to detect Null value from a ListBox
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2019, 12:36 PM
  3. excel vba - listbox displays 12/30/99 when value is null
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2017, 09:52 AM
  4. [SOLVED] Why are there Empty/Null/Blank Rows in my ListBox?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-02-2014, 09:25 PM
  5. [SOLVED] Listbox.value is null
    By Hammer_757 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2012, 11:41 AM
  6. [SOLVED] Invalid Use of Null - Formating listbox column
    By chinaboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-24-2012, 02:48 PM
  7. [SOLVED] Macro: Listbox value null
    By jomili in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2009, 04:47 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