+ Reply to Thread
Results 1 to 7 of 7

Filter data in listbox based on two conditions by selected from combobox

  1. #1
    Forum Contributor
    Join Date
    06-17-2021
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    219

    Filter data in listbox based on two conditions by selected from combobox

    Hi

    I need to populate data for column A,B and the column contains date in header with match selected date from combobox1
    the column date will contains numeric values.
    and if combobox2 contains two conditions (not zero, zero)
    when select date from combobox1 will populate data after matching the date is in header in row1 and when select not zero from combobox2 then will populate data except containing zero or empty in column(3) in listbox . when select date from combobox1 will populate data after matching the date is in header in row1 , when select zero from combobox2 then will populate data except containing not zero in column(3) in listbox . when select date from combobox1 will populate data after matching the date is in header in row1
    the populate data on userform
    first when just select combobox1 should populate all of numeric numbers also zero and empty cells as in image1.
    second depends on select combobox1 ,case from combobox2(NOT ZERO) as in image2
    third depends on select combobox1 ,case from combobox2(ZERO) as in image3
    also cross posted here with a little different
    https://www.mrexcel.com/board/thread...bobox.1255108/
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: Filter data in listbox based on two conditions by selected from combobox

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Filter data in listbox based on two conditions by selected from combobox

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Filter data in listbox based on two conditions by selected from combobox

    When "CASES" is blank, show all.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 03-16-2024 at 10:09 PM. Reason: typo

  5. #5
    Forum Contributor
    Join Date
    06-17-2021
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    219

    Re: Filter data in listbox based on two conditions by selected from combobox

    @JT your code works as I want it , thank you so much.
    @BVJ your code works for when select the date from first time ,if I select another date will not work the code . I should close the form and select another date to work the code .anyway thank you.
    @jindon your code works perfectly , thank you so much.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Filter data in listbox based on two conditions by selected from combobox

    You are welcome and thanks for the rep.

    If you don't want the listbox to have extra brank rows, use mine...

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: Filter data in listbox based on two conditions by selected from combobox

    You are welcome and thanks for the rep.

+ 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] filter data in listbox based on two selection combobox (sheets & headers) and texebox
    By abdo meghari in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-05-2021, 05:31 AM
  2. populate data in listbox based on selected on combobox and datepicker
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2020, 02:20 AM
  3. Filter excel sheet rows based on value selected in combobox -VBA
    By sharpre3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2019, 03:12 AM
  4. Replies: 0
    Last Post: 05-06-2019, 03:36 PM
  5. [SOLVED] ComboBox to filter Listbox Data
    By TommyMurphy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-02-2019, 12:25 PM
  6. [SOLVED] Filter ListBox based on ComboBox selection
    By nimesh29 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2017, 03:14 PM
  7. [SOLVED] Userform - ListBox items added based on Combobox value selected
    By jayherring86 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-12-2014, 09:12 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