I have a table with a column 4 that contains a bunch of different genres:
I would like to make something that can filter the column based on genres I choose. This is what I have so far:
In a different sheet, there are checkboxes for each different genre (in this example only 3 genres) and by clicking on the checkboxes, the string in cell C2 adds the name of the genre in such a way so that it can be used to filter column 4 in the table.
My issue is that now that I have my desired filter in cell C2, I want to apply this search string to the column to filter out the rows, as if I was doing it manually like this:
So when I click on the "Filter" button (in the second image) this search string gets applied from cell C2 and filtered out.
This is what my macro for the Filter button looks like so far:
Private Sub CommandButton1_Click()
Worksheets("TableSheet").ListObjects("Table1").Range.AutoFilter Field:=4, Criteria1:= _
Worksheets("GenrePick").Range("C2").Value
End Sub
Where sheet "TableSheet" contains the table I want to filter in, and sheet "GenrePick" is the sheet where I choose the genres to filter by.
This current macro filters out all rows and doesn't match with the rows that fit the criteria.