How To Autofilter Rows Based On Cell Value In Excel?

Rashie

Board Regular
Joined
Jun 5, 2015
Messages
55
Hey All,

I'm having a nightmare with this seemingly simple task.

I have several cells as below
E USD
E GBP
E EUR5
O USD
O USD
O USD

<tbody>
</tbody>

<tbody>
</tbody>

And another table of data below with a frozen pane, A10:Z2500.
Using an example of E EUR this data is in column J, O USD is in column K etc
I just want to use a filter function where instead of using the auto filter I can enter an amount next to each cell as above and have it filter automatically.

I can make it work individually but I can't have all 6 functional at the same time.

Any ideas?

Thanks All :)

Sorry, should have posted my semi successful code too. I just want to have this working at the same time for all 6 data cells.


Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngTrigger As Range
Dim rngData As Range
Dim lngCol As Long

'----SETUP---
'Which cell are you typing in?
Set rngTrigger = Range("B3")
'Where is the data to be filtered?
Set rngData = Range("A10:Z2500")
'what number column are we filtering of the table?
lngCol = 1
'------------

'Check if user changed our cell of interest?
If Intersect(Target, rngTrigger) Is Nothing Then Exit Sub

Application.ScreenUpdating = False
With rngData
'Clear previous filter
.AutoFilter
'Apply new filter
.AutoFilter field:=lngCol, Criteria1:=rngTrigger.Value
End With

Application.ScreenUpdating = True
End Sub
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
The code says that you filter in column 1, but in your explanation you want to filter in column J, or I'm not really understanding what you need.
 
Upvote 0

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

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