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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,224,749
Messages
6,180,725
Members
452,995
Latest member
isldboy

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