+ Reply to Thread
Results 1 to 5 of 5

Populate multiple column listbox

  1. #1
    Registered User
    Join Date
    12-09-2019
    Location
    Skipton, England
    MS-Off Ver
    16
    Posts
    3

    Populate multiple column listbox

    Hi All!

    Id Like to populate a multiple column listbox using a textbox and a commandbutton, i would like 7 columns and my data within these columns to come from one of my data tabs 'PRIMARY'.

    The data i'd like to populate my listbox is (in the order id like it) in column J, column A, column FP, column B, Column FO, column FM and column FN.
    J = WO No.
    A = Wp No.
    FP = BM No.
    B = Quality
    FO = Location
    FM = Date of manufacture
    FN = ORGANIC Y/N?


    I would like to be able to automatically filter out certain results based on the selection of two checkboxes - checkbox1 to add a filter to INCLUDE beams currently in Quarantine - and checkbox2 to add a filter to INCLUDE results 'IN LOOM'



    Im sure this is possible, as ive managed to pull bits of data through into my listbox, but as for filtering i have become very stuck!!

    Thanks in advance for any help anyone can offer!

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Populate multiple column listbox

    Hi
    please read the yellow banner. it's NOT about advertising...

  3. #3
    Registered User
    Join Date
    12-09-2019
    Location
    Skipton, England
    MS-Off Ver
    16
    Posts
    3

    Re: Populate multiple column listbox

    Hi Pepe Le Mokko!

    This isnt an advert? im looking for help?

    Josh

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Populate multiple column listbox

    Please post a sample sheet as requested. Thanks

  5. #5
    Registered User
    Join Date
    12-09-2019
    Location
    Skipton, England
    MS-Off Ver
    16
    Posts
    3

    Re: Populate multiple column listbox

    Attachment 653351Attachment 653352Attachment 653353


    I have managed some of the code, but am nowhere near filtering the data yet, for a standard search i would only like to include results from locations R1-R10
    including results from quarantine checkbox would include Qu1 and Qu2
    including results from in loom would include from 501-570

    here is the code i have so far..

    Dim rng As Range
    Dim ws As Worksheet
    Dim i As Integer

    Set ws = Worksheets("PRIMARY")
    Set rng = ws.Range("A:GO")
    Set fnd = rng.Find(TextBox1)
    If fnd Is Nothing Then MsgBox TextBox1 & " not found": Exit Sub
    Set first = fnd
    With ListBox1
    .Clear
    .AddItem fnd.Offset(, 1)
    .List(.ListCount - 1, 1) = fnd.Offset(, 9)
    .List(.ListCount - 1, 2) = fnd.Offset(, 0)
    .List(.ListCount - 1, 3) = fnd.Offset(, 171)
    .List(.ListCount - 1, 4) = fnd.Offset(, 1)
    .List(.ListCount - 1, 5) = fnd.Offset(, 170)
    .List(.ListCount - 1, 6) = fnd.Offset(, 168)
    .List(.ListCount - 1, 7) = fnd.Offset(, 169)

    Do
    Set fnd = rng.FindNext(fnd)
    If fnd.Address = first.Address Then Exit Do
    .AddItem fnd.Offset(, 1)
    .List(.ListCount - 1, 1) = fnd.Offset(, 9)
    .List(.ListCount - 1, 2) = fnd.Offset(, 0)
    .List(.ListCount - 1, 3) = fnd.Offset(, 171)
    .List(.ListCount - 1, 4) = fnd.Offset(, 1)
    .List(.ListCount - 1, 5) = fnd.Offset(, 170)
    .List(.ListCount - 1, 6) = fnd.Offset(, 168)
    .List(.ListCount - 1, 7) = fnd.Offset(, 169)
    Loop
    End With


    Thanks in advance for any help anyone can give!!!

+ 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. populate listbox with multiple columns
    By willsnake in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-13-2018, 12:59 AM
  2. [SOLVED] Populate listbox from its second column
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2018, 11:46 AM
  3. [SOLVED] Listbox to populate data from column B
    By bimmy80 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2015, 11:11 PM
  4. Replies: 1
    Last Post: 07-24-2014, 02:08 PM
  5. Populate data in 2 column listbox using vba
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2014, 04:49 AM
  6. How to populate multiple column listbox with unique combinations only
    By shuvajit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2012, 12:37 AM
  7. [SOLVED] Populate Multiple Fields from Mutiple Column Listbox
    By sgwilliams in forum Excel General
    Replies: 6
    Last Post: 02-07-2011, 02:47 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