Results 1 to 16 of 16

Show filtered data in listbox on a userform

Threaded View

kammend Show filtered data in listbox... 12-09-2021, 04:48 AM
Sintek Re: Show filtered data in... 12-09-2021, 05:52 AM
kammend Re: Show filtered data in... 12-09-2021, 06:11 AM
Sintek Re: Show filtered data in... 12-09-2021, 06:15 AM
kammend Re: Show filtered data in... 12-09-2021, 06:29 AM
Sintek Re: Show filtered data in... 12-09-2021, 06:30 AM
kammend Re: Show filtered data in... 12-09-2021, 06:33 AM
kammend Re: Show filtered data in... 12-09-2021, 06:39 AM
kammend Re: Show filtered data in... 12-09-2021, 06:45 AM
Ali-M Re: Show filtered data in... 12-09-2021, 06:52 AM
Sintek Re: Show filtered data in... 12-09-2021, 06:54 AM
Sintek Re: Show filtered data in... 12-09-2021, 07:13 AM
kammend Re: Show filtered data in... 12-09-2021, 09:28 AM
torachan Re: Show filtered data in... 12-09-2021, 09:06 AM
Artik Re: Show filtered data in... 12-09-2021, 10:03 AM
Sintek Re: Show filtered data in... 12-09-2021, 10:34 AM
  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    The Netherlands
    MS-Off Ver
    2016 x64
    Posts
    48

    Show filtered data in listbox on a userform

    Hello,

    In a worksheet I have a list with different kinds or records (errors, warnings, etc). I also have a userform that can show these. What I want to accomplish is that I can use a optionbutton to filter 1 type of record and show that in that listbox of my userform. See attached.

    I am able to show all data in the listbox. And I am also able to filter the data in the table. However, I cannot get only the filtered data in the listbox.

    Private Sub OptionErrors_Click()
    
    Dim wsw As Worksheet
    Set wsw = Worksheets("Warnings")
    wsw.Range("ErrMsg_Filter").Value = "Err"
    
    Dim i As Integer   ' row in Warning ws
    i = 5                 ' first row
    
    Dim LastRow As Long
    
    LastRow = wsw.Range("A" & Rows.Count).End(xlUp).Row   ' Last row in Warnings ws
    If LastRow < 5 Then LastRow = 5
    
    Dim lo As ListObject
    Set lo = wsw.ListObjects(1)
    lo.AutoFilter.ShowAllData
    
    With lo.Range
        .AutoFilter Field:=6, Criteria1:="E"
    End With
    
    Dim rngWarnings As Range
    Set rngWarnings = lo.DataBodyRange.Columns("B:F")
    
    With Me.ListBox1
        .ColumnWidths = "30;50;325;450"
        .ColumnCount = -1
        .List = rngWarnings.Cells.Value
    End With
    
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Populate UserForm ListBox with unique values from filtered data
    By karmapala in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2019, 12:54 PM
  2. [SOLVED] Want to Show Filtered data in Listbox with Tickbox Option to Filter data
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2017, 11:55 AM
  3. [SOLVED] Want to Show Filtered data in Listbox with Tickbox Option to Filter data
    By HaroonSid in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2017, 05:49 AM
  4. [SOLVED] How to filter a table using textbox and show filtered data in listbox (userform)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2017, 10:31 AM
  5. [SOLVED] How to show data in UserForm ListBox from WorkSheet?
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-31-2014, 05:26 PM
  6. Userform to show filtered data
    By onsid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2013, 02:56 PM
  7. Using Filtered Data in Userform Listbox
    By sfinney in forum Excel General
    Replies: 0
    Last Post: 03-18-2005, 11:09 AM

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