+ Reply to Thread
Results 1 to 4 of 4

combobox blank spaces when populating

  1. #1
    Forum Contributor
    Join Date
    06-27-2014
    Location
    bristol, england
    MS-Off Ver
    excel 2007
    Posts
    264

    combobox blank spaces when populating

    hi guys I have a combobox on a userform, the row source property I have set to Records F:F, this populates the combo with all the records available, but also shows all the blank cells if no data is available down column F, what code do I need so that the combo will populate but without blank rows, (the code I use to find the record all works fine, its just the blank spaces within the combobox, which does not look very good.
    any help appreciated

    scouse13

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: combobox blank spaces when populating

    Create a named range. For this example let's call it ComboList. It should be defined as

    =OFFSET(Records!$F$1,0,0,COUNTIF(Records!$F:$F,"*?"),1)

    This assumes there is no header row.

    Then use ComboList for your row source property.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: combobox blank spaces when populating

    You have an elegant solution from 6StringJazzer; however, if you are looking for a code solution that you can integrate within your existing code procedures, then I have two possibilities to offer depending on if your data contains spaces within the cell values or not.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 05-09-2020 at 12:18 AM.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,030

    Re: combobox blank spaces when populating

    Another option
    Please Login or Register  to view this content.

+ 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] ActiveX Combobox in worksheet when populating the list based on another Combobox get error
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2020, 10:54 AM
  2. Replies: 3
    Last Post: 03-22-2018, 11:25 AM
  3. Populating Combobox based on Combobox selection from EXCEL worksheet
    By JChaney17 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-04-2014, 08:14 AM
  4. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  5. Populating combobox 2 with items that match criteria from combobox 1
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-13-2013, 03:00 AM
  6. Removing Duplicates from ComboBox and Populating one combobox based on another
    By kbmtech in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2010, 11:17 PM
  7. Populating the list in a combobox based off the value chosen in another combobox
    By Mervil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2010, 11:50 AM

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