Can I run the filter for Column A off the drop down menu in Cell D9?

jeskel

New Member
Joined
Sep 27, 2018
Messages
14
Any Help would be appreciated. I had one issue solved on here today if I can get this one I would be ecstatic!

Thank you!

- Jessy
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Any Help would be appreciated. I had one issue solved on here today if I can get this one I would be ecstatic!

Thank you!

- Jessy
Are you wanting the filter script to automatically run when you change a value in D9?

Or are you saying you want to filter the range according to the value in D9

Or both.

Show us the script which will do the filtering's.
 
Upvote 0
This will automatically filter col A, whenever D9 is changed.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Not Target.Address(0, 0) = "D9" Then Exit Sub
   If Target = "" Then
      Range("A10:C10").AutoFilter 1
   Else
      Range("A10:C10").AutoFilter 1, Target.Value
   End If
End Sub
This needs to go in the sheet module containing the D9 drop & assumes the data to filter is on the same sheet.
 
Upvote 0
Are you wanting the filter script to automatically run when you change a value in D9?

Or are you saying you want to filter the range according to the value in D9

Or both.

Show us the script which will do the filtering's.

I want the Filter Script to automatically run when I change the value using the drop down menu in cell D9. Cells D10:D13 Change already based on value in D9 so does cell H8
But I want when I switch the selection in cell d9 for column A to display only the info as shown below:

Cell D9: ASA Alloys Inc
D10: Name
D11: Address
D12: Address


Column A
Castle
ASA
RASCO
EMJ
ASA
Castle
EMJ
ASA
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
This will automatically filter col A, whenever D9 is changed.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Not Target.Address(0, 0) = "D9" Then Exit Sub
   If Target = "" Then
      Range("A10:C10").AutoFilter 1
   Else
      Range("A10:C10").AutoFilter 1, Target.Value
   End If
End Sub
This needs to go in the sheet module containing the D9 drop & assumes the data to filter is on the same sheet.

Good Morning the code above worked however I have been finding that after w while of having the spreadsheet open it decides not to work and i have to close and re-open to make it work again.
Any Ideas on how to make it work constantly without this issue?

Thanks again!

- Jessy
 
Upvote 0
When you say it stops working, do you get any errors, does Xl crash, or is it simply that the sheet no longer filters?
 
Upvote 0

Forum statistics

Threads
1,217,331
Messages
6,135,938
Members
449,973
Latest member
jarzack

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