UserForm autofilter method

AndyEd

Board Regular
Joined
May 13, 2020
Messages
124
Office Version
  1. 365
Platform
  1. Windows
In the attached example I have a UserForm which selects records (rows) from sheet (Tracker). The record displayed is based on a combobox selection.

I would also like to filter the tracker sheet by file type (e.g. Open, Closed, Pending) and only display any relevant records. Would the best way be via a series of command buttons, radio buttons, or combobox?

Please see the attached for reference.

Test - Copy.xlsm

Thank you
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
If you do use a combobox, here is the code you can use, this example I named it cbo_FileType
In the UserForm_Initialize, populate the combobox
VBA Code:
    With Me.cbo_FileType
        .AddItem "Open"
        .AddItem "Closed"
        .AddItem "Pending"
    End With
Then when you make a selection in the combobox, the comboboxChange event will kick in.

VBA Code:
Private Sub cbo_FileType_Change()
    Dim sh As Worksheet
    Set sh = Sheets("Tracker")
    With sh
        .Range("A2").AutoFilter field:=4, Criteria1:=Me.cbo_FileType
    End With
    
End Sub
 
Upvote 0
Hi Dave

Works a treat on the spreadsheet. I have however noticed that although the spreadsheet is filtered, when I then scroll though the records via the UserForm, using the Select Person combobox, all the records are still visible, not just the filtered selection.

Also, how would you factor in the removal of the filter to view all the records? as part of the selection process?

Thank you
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,274
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top