+ Reply to Thread
Results 1 to 12 of 12

Fill a LISTBOX from a range, WHITOUT BLANK ROWS

  1. #1
    Registered User
    Join Date
    11-06-2011
    Location
    france
    MS-Off Ver
    Excel 2003
    Posts
    6

    Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Dear all,

    i'm brand new user from Paris, France, and hope that i will find here expertise to solve my issue :

    i would like to display in a Listbox a Range values (A1:D100), but there are empty rows and don't want to display them in the Listbox . It is possible ?

    thank you for your support

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,249

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Hi aleebaba and welcome to the forum,

    I'd filter the range to another place and then display this filtered set of rows.

    If you know VBA then creating a Collection of Items that are in A1 to D100 might also work.
    See
    http://www.functionx.com/vbaexcel/objects/Lesson6.htm

    We really need an example file to see what you want. You can attach a sample by clicking on Go Advanced and then the Paper Clip Icon.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-06-2011
    Location
    france
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Sorry !! this is MY CODE :

    I've also researched different ways to obtain what i want (first copy/paste the range in another
    sheet avoiding blank cells) but i'd like to do it directly in this code -
    i have a second problem : respect the different lines in the range (at the end of the first line, Chr(13), next non empty row,...etc)

    Please Login or Register  to view this content.
    Last edited by aleebaba; 11-06-2011 at 02:28 PM.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,249

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Hi aleebaba,

    Could you edit your above two posts and then click on "Go Advanced" and select the code and click on the "#" Icon to put Code Tags around the code so it looks like this >>
    Please Login or Register  to view this content.
    Then - did you have more questions or does you code work for you? Is this problem solved?

  5. #5
    Registered User
    Join Date
    11-06-2011
    Location
    france
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    OK Marvin , Done !

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,249

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Hi,

    Is the problem solved yet? You should put your first post in code tags also. It just makes them easier to read and copy when we look at them.

  7. #7
    Registered User
    Join Date
    11-06-2011
    Location
    france
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Not yet Marvin, i was talking about the posting code under the right format ,

    here it is :


    Please Login or Register  to view this content.

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,249

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Hi,

    You now have to learn how to attach a sample workbook that we can use to solve your question. Click on "Go Advanced" and then the Paper Clip Icon above the Advanced Message area. This will allow you to show what you are doing.

    AND - the VBA to Sort a Collection is at http://www.dailydoseofexcel.com/arch...-a-collection/
    Search on "Excel Collection Sort" to find many more examples.

  9. #9
    Registered User
    Join Date
    11-06-2011
    Location
    france
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    ok , hope it is attached now
    Attached Files Attached Files

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    15,249

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    OK - try the code in the attached.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-06-2011
    Location
    france
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Well Done !!

    Thank you so much for your assistance Marvin !

    See you ...

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Fill a LISTBOX from a range, WHITOUT BLANK ROWS

    Your Title says ListBox, uyour code is for a textBox
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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