
Originally Posted by
JorisDDS
Thanks for the help so far ; I had to adjust a few things because you put the values in the labels in the array where the labels of the projects contain other information too. Giving the following code :
while testing I noticed that the arrays don't seem to build up as they should. The filter only works for the first added value, not the others in the array

So if I check the A and B priority it only filters on A priority and hides the B.
I thought I had stripped out the other info from the Labels.
D(j) = Left(.Caption, InStr(.Caption, " (") - 1) 'remove (#) from caption
Tip: instead of the x variable, you could use j + 7. This is not your problem though.
D(j) = (Sheets("Tabellen").Cells(j + 7, "S").Value)
Your example workbook had autofillter only on columns C5:V5. (not column B).
Your code in AlgemeenOverzicht_Click includes column B in the Autofilter range.Private Sub AlgemeenOverzicht_Click()
ActiveSheet.Range("$B$5:$V$5000").AutoFilter Field:=20, Criteria1:="=true"
If column B is included, then change this...
The field number is dependent on the columns you include in the filter range. (Hidden columns are not counted)
Also: Be aware that filter criteria for the three columns (column D, column K, and you added column 20 = "true") are addative. All three columns have to match one critera in their respective Array. If there is a match in column D, there would also have to be a match in column K for that same row for it to be visible (and column 20 has to also equal True). Your example file doesn't have any values in column 20. As best I can tell that is column AA based on the columns you have hidden.
You can use this autofilter for column 20 as its' criteria is not an array.
.AutoFilter Field:=20, Criteria1:="true"
Bookmarks