+ Reply to Thread
Results 1 to 2 of 2

Sorting ListBox Values into a Separate ListBox

  1. #1
    Registered User
    Join Date
    01-21-2019
    Location
    Australia
    MS-Off Ver
    Office 2018
    Posts
    35

    Sorting ListBox Values into a Separate ListBox

    Hi,

    I am attempting to creating a shipping optimisation program, and a step along the way is extracting values from a ListBox (ListBox2) that are below a certain value (2300).
    I cant seem to be able to successfully run a sub that checks each value in the second column of ListBox2, and if this value is below 2300, it adds the entire row to a separate ListBox (ListBox3).
    I have included the code below and I'm sorry in advance, I'm sure this is a really simple question!
    Please Login or Register  to view this content.

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

    Re: Sorting ListBox Values into a Separate ListBox

    The second column in a ListBox has index 1 because indexes for Rows and Columns in a ListBox start at 0.

    Also you will have to loop through each column of a record in listbox2 to add it's value to listbox3
    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.

+ 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] Show unique values in listbox and activate related cell if i select value in Listbox
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2018, 06:54 AM
  2. vba excel - adding listbox values from listbox
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-23-2017, 06:30 PM
  3. Show dynamic values at listbox depending value selected another listbox
    By Judith_Chao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2017, 08:30 AM
  4. [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
  5. [SOLVED] How do I populate a listbox with a list excluding values found in another listbox?
    By Hokiefan00 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2014, 01:47 PM
  6. Based on listbox values, go to a URL in webbrowser containing those listbox values
    By krisspy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-08-2014, 02:05 PM
  7. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 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