+ Reply to Thread
Results 1 to 10 of 10

Multiple ListBox Change

  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Multiple ListBox Change

    Hi All,

    I have several pages with about 80-100 Listboxs on as they are used to pick what vehicles each ticket corresponds to.

    I need to update the list of all of the listboxs to add some more vehicles, is there a way using VBA to amend all the ListBox's on a sheet to point to different list selection?

    Many Thanks,
    James

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    How are they currently being populated?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Multiple ListBox Change

    They are being selected by the user clicking the relevant vehicles and then saving the sheet and sending it to me.

    I understand I cannot change the order of the listed items as where they have clicked would change, I just want to add some more to the bottom of the list.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    What I meant was how are the listboxes being populated with values?

    Are you using a range?

    Perhaps there's code that does it.

  5. #5
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Multiple ListBox Change

    All of listboxes are being populated with an Input Range. I wish to change the Input Range, on all of the listbox

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Can you attach a sample workbook so we can see what you have?

  7. #7
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Multiple ListBox Change

    Hi, here is a small sample attached.
    Attached Files Attached Files

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple ListBox Change

    James

    Create a (dynamic) named range called VehicleList that refers to this formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then run this code to update all the listboxes on Summary to take their list from the named range.
    Please Login or Register  to view this content.
    Now whenever you add (or delete) vehicles from the list the listboxes will update accordingly.

  9. #9
    Registered User
    Join Date
    03-09-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Multiple ListBox Change

    Hi Norie,

    I do not understand the first part..

    I have pasted the formula into a cell and defined its name to VehicleList but then it just gives to listbox a list of 1 vehicle.

    James

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Multiple ListBox Change

    James

    On the Formulas ribbon goto Name Manager.

    If VehicleList is already listed in the Name Manager delete it.

    Then click New...

    For Name enter VehicleList and for Refers to enter this formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then press OK.

+ 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