+ Reply to Thread
Results 1 to 6 of 6

Add RowSource list to ListBox based on Selected Sheet

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Add RowSource list to ListBox based on Selected Sheet

    Dear All,

    Trust you're all well.

    I have created few sheets with different products. I have created the same Named Range (Product_List) to all with Sheet scope.

    I want the user to choose the product, based on the sheet name and the named range to appear on the listbox of userform.

    So far I am not able to set the listbox RowSource.

    I have attached the file.

    Any assistance will be highly appreciated.

    Best regards,
    Filipe


    * If a reply solved or answered your query/question, you can add reputation to the person by clicking on the * Add Reputation
    * When question is resolved, please mark your thread as SOLVED


    Thanks and regards,
    Filipe Oliveira

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Add RowSource list to ListBox based on Selected Sheet

    All you need is:

    Please Login or Register  to view this content.
    Rory

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

    Re: Add RowSource list to ListBox based on Selected Sheet

    Also, make your ranges dynamic instead of refering to an entire column.
    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.

  4. #4
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Add RowSource list to ListBox based on Selected Sheet

    Is this what you are looking for?
    I Created 3 tables for the 3 lists.
    See attached.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Add RowSource list to ListBox based on Selected Sheet

    Hi Rory,

    Wow !

    And I thought I needed a big code or such... and all I needed was just a line

    Thanks a million for your help in here, really appreciated.

    Have a great weekend,
    Filipe

  6. #6
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Add RowSource list to ListBox based on Selected Sheet

    Hi There,

    Thanks a million for your code.

    It did worked well alright but the only thing I do not want is to create tables for the named ranges.

    The file I have attached in only for test purposes.

    On the Original file, when user creates a new sheet, it will create the same named range. The only thing it will change will be the sheet name.

    I am thinking now to create a dynamic named range without creating a table for it.

    Thanks a million anyway. I might use your code for other projects

    Best regards,
    Filipe

+ 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] How to populated Listbox from Hidden sheet with rowsource property
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2018, 09:20 AM
  2. VBA to delete rowsource of selected row in listbox
    By chrismccarthy17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2016, 02:24 PM
  3. [SOLVED] Find all instances of Now in active sheet and use as listbox rowsource
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2015, 02:41 AM
  4. [SOLVED] Listbox Rowsource based on columns
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2014, 04:45 PM
  5. display content in excel sheet using listbox rowsource vba
    By tkfei in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2011, 05:45 AM
  6. Changing rowsource of 2 listboxes based on 3rd listbox.
    By scadaman29325 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2008, 11:20 AM
  7. [SOLVED] Filtered List as Listbox RowSource
    By Ken McLennan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-20-2005, 08:05 PM

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