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.
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.