+ Reply to Thread
Results 1 to 5 of 5

Pre-select item in listbox

  1. #1
    Registered User
    Join Date
    06-30-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    8

    Pre-select item in listbox

    Hello

    Please see the attached.

    ProjectMatrix.xlsm

    By changing the combobox I want the listbox to pre-select based on the values in the table. Eg. Select 'Project 1' and Test1, Test7 and Test8 should preselect in the listbox

    Got myself in a muddle with with code I have previously found...help!

    Thanks
    PK

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Pre-select item in listbox

    You need to make sure you have enabled multi. Select in the list box properties.

    Then loop through each item in the listbox and set it as selected if that is your intention.

    Listbox1.selected(count) = true
    Last edited by mehmetcik; 07-03-2015 at 08:03 AM.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Pre-select item in listbox

    Try:-
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-30-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    8

    Re: Pre-select item in listbox

    Mick - thanks v much!

    I changed the .resize as it will be dynamic - works great

    Please Login or Register  to view this content.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Pre-select item in listbox

    You're welcome
    (Good shout)

+ 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] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  2. Is it possible to pre-select an item in a ListBox in a Userform?
    By bananajelly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2014, 02:14 PM
  3. Select one item from a listbox disables another listbox
    By EagleInsight in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2014, 09:53 PM
  4. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM
  5. How to select a default item in the VB ListBox?
    By qed59 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2010, 01:16 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