Hi everyone
Sorry for sounding a little too green behind the ears
I have a spreadsheet with employees and data listed. The drop-down in A1 lets someone select the employee and then it hides the rows for all other employees. I want to add the names of supervisors in the drop-down of A1 and have it select only the employees under that supervisor and hide the rest. The number of employees under each supervisor ranges from 3 to 6. This is what I have to hide the rows when selecting a single employee :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim v As Variant, i, j As Long
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveWindow.FreezePanes = False
UsedRange.Rows.Hidden = False
If IsEmpty(Cells(1, 1)) Then Exit Sub
v = Cells(1, 1).Value
For i = 2 To 40 ' Show/Hide the Analysts rows - Add/Substract to the second number when adding/removing analysts
If Not Cells(i, 1) = v Then Rows(i).Hidden = True
If v = "Select Analysts/Supervisors" Then Rows(i).Hidden = False
Next i
Cells(2, 1).Select
ActiveWindow.FreezePanes = True
Cells(2, 1).Select
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
My workbook has stats data on the "Master" sheet(sheet #1) and analysts and supervisors on "Analysts" sheet(sheet #12). Data validation for cell A1 on "Master" sheet has all the analysts and supervisors in the first column of "Analysts" sheet with title "Select Analyst" in cell A1. I modified the "Analysts" sheet to show supervisors from B1:I1 and listed the analysts in the appropriate columns below them. Not sure how to make it select the analysts when someone selects the supervisor on "Master" sheet
Bookmarks