Filter based on named range input

Ralfdenouden

New Member
Joined
Feb 3, 2016
Messages
2
Hello,

I am building a worksheet to keep track of a project which runs on several departements with their specific production codes. On a tab I have made a column with the name of each departement and below the produciton coded of this departement. From this list I have created a dynamic named range. On the tab where I collect all the information from hours spent I want to filter on the departement name which should gives the result showing all the production codes of the departement.
I have made a validation list where I can pick the departement. This validation is linked with the next cell were the dynamic named range is showing up. This cell is used in the vba code but the result of the filter is an empty sheet.
Below is the code I used:
Sub filter_bewerkingscode()

With Sheets("Urenbewerk")

.Range("A9:L600").AutoFilter Field:=4, Criteria1:=.Range("F5")

End With

End Sub

Range A9:L600 is the area where the input is (Later this should also be replaced by a dynamic range)
In field 4 are the production codes
Criteria1 is mentioned in cell F5 which is the output of the validation box.

Can anybody tell me what I am doing wrong?
Thanks in advance.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,215,656
Messages
6,126,055
Members
449,284
Latest member
fULMIEX

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