+ Reply to Thread
Results 1 to 5 of 5

ActiveX Listbox update list range

  1. #1
    Registered User
    Join Date
    08-01-2018
    Location
    sweden
    MS-Off Ver
    2016
    Posts
    2

    ActiveX Listbox update list range

    Hi

    i have a formula that creates a varible list depending on a selected criteria.
    Instead of using the formula in a datavalidation dropdown list i use a Active X listbox.

    First i have a Listbox1 that displays all my criterias and when i select my criteria in listbox1 all the unique matches is displayed in ListBox.2.

    Now the problem is that sometimes i can have up to 50 unique matches and sometimes just 3, but the scrollbar doesnt change so im not able to scroll throu all the unique items.
    How can i do so that the scrollbar and number of shown items updates when i cange the criteria?

    i'v never worked with VBA code, so if someone knows how to solve it please don't override my brain

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: ActiveX Listbox update list range

    Have a look at the ListRows-property of the Combobox.

    You can set this previously to filling the Combobox with items depending on the number of unique matches.

    It all depends on how you create your unique list.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    08-01-2018
    Location
    sweden
    MS-Off Ver
    2016
    Posts
    2

    Re: ActiveX Listbox update list range

    This is the formula im using
    =OFFSET(Ventiler!$B$1;MATCH(Sheet1!$B$8;Ventiler!$A$2:$A$400;0);0;COUNTIF(Ventiler!$A$2:$A$400;Sheet1!$B$8);1) that i have put in Namemanger under DepDropDownList.

    Im trying to avoid Combobox since it crashes Excel when arrowing down, so thats why i like to use the Listboxinstead

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: ActiveX Listbox update list range

    Can you post an example file. Remember to desensitize data if needed.

  5. #5
    Registered User
    Join Date
    06-21-2018
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    9

    Re: ActiveX Listbox update list range

    Hello Fillemang,

    I'm not sure I perfectly understand what do you need but check if the attached picture is what you need. You can type the maximum number of possible rows although I doubt it will gather more than ~50 on one screen. If the actual list is less than that it will automatically shrink and enlarge.
    Attached Images Attached Images

+ 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 Listbox in Excel populated using SQL by pulling out the list from a database.
    By mtilbury in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-19-2017, 05:42 PM
  2. how to set row source/List fill range for ActiveX control Listbox via VBA code.
    By Raf_sia in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2015, 12:02 PM
  3. HELP: Populate Worksheet ActiveX listbox using Named Range
    By nori79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2015, 09:25 AM
  4. HELP: Adding Named Range to a ActiveX ListBox
    By nori79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2015, 02:06 AM
  5. Replies: 11
    Last Post: 01-16-2015, 07:04 PM
  6. [SOLVED] fill listbox (ActiveX) based combobox (ActiveX)
    By elsg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-31-2014, 11:25 AM
  7. [SOLVED] For next loop multiselect activex listbox won't list items in seperate cells. Only 1st
    By Dabbler39 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-05-2013, 03:25 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