filtering rows based on a cell input

psyCohn

New Member
Joined
Aug 19, 2015
Messages
4
Office Version
  1. 2016
I have a file with 2 worksheets. The first one is for entering certain employee fields, and the 2nd worksheet shows all current employees. One of the input fields in the first sheet is for a JOB_CODE number. Is it possible to link that to the 2nd sheet where as soon as I enter that JOB_CODE, the 2nd tab will filter the rows such that they only show the rows for the employees with that same JOB_CODE? The Advanced option in the Filter won't do this. Thanks for the help...
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
How about
Code:
Private Sub Worksheet_change(ByVal Target As Range)

Application.EnableEvents = False
   If Target.CountLarge > 1 Then Exit Sub
   If Target.Column = 2 Then
      Sheets("Sheet2").Range("A1").AutoFilter 2, Target.Value
   End If
Application.EnableEvents = True

End Sub
This needs to go in the sheet module where you enter the data.
As you haven't given us much info It works whenever you enter data in col B & will filter sheet2 col B
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,520
Members
448,968
Latest member
Ajax40

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