Auto-filter based on cell value won't work!

LiinaNeedsAdvice

New Member
Joined
Sep 8, 2015
Messages
1
Hi!
I have a VBA issue that is taking up way too much time guessing at. So, I hope that someone may be able to help!
I have a product listing table ranging from A6 (heading) to BB2609 (including subtotal).
I am trying to auto-filter column O to display what is found in cell O5. Cell O5 is made up of =F2&F3&F4&F5 , all of which are free entry cells for either Y for yes or N for no, for different product categories that can be chosen for inclusion in the table, or not.
This is the code I have entered for auto filter of column O based on O5, but it doesn't work. Can anyone help me to figure out why? What can I do to make this work?
Here is the code I have entered:

Private Sub Worksheet_Change(ByVal Target As Range)
If (Intersect(Target, Range("O5")) Is Nothing) _
Then
Exit Sub
End If
Cells.AutoFilter Field:=15, Criteria1:="=" & Range("O5")
End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
you need to define your range of the autofilter
so range("A6:BB2609") ?

also if you are working with autofilter it is good practice you need to reset the filter first
otherwise if existing filter is already then it will try to add to current filter...which is often not what you want?

with your setup
hard to tell what your working with the data your have provided
maybe a sample sheet would be helpful
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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