Dear All,
I created a data validation list to select multiple items. These items get accumulated with a comma (like Item1, Item2, etc..) in the adjacent.
I have written a small VB code to apply autofilter on a data sheet based on these filter criteria. Below is the code.
This works fine it is a single selection. But does not work with multi-filtering with commas.If Target.Address = "$I$5" Then If Target.Value <> "All" Then Set r = sh.AutoFilter.Range r.AutoFilter Field:=10, Criteria1:=Me.Range("I5").Value End If End If If Target.Address = "$I$5" Then If Target.Value = "All" Then Set r = sh.AutoFilter.Range r.AutoFilter Field:=10 End If End If
Please shed some light on how I can get around this. Bottomline, I want to autofilter items based on multiple options selected.
Thanks.
Hi
In Excel 2007 you can Filter using an array. See an example of that here http://vbadud.blogspot.com/2010/07/e...-multiple.html
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks