I am trying to cut down a list of employees and their corresponding sales territories according to another sheet that I have created (ActiveReps). I was wondering what I would run to hide all of the rows that have a rep and territory that do not match my other sheet. Thanks for any help, its greatly appreciated!
Add a column to employee sheet and enter =VLOOKUP(A1,Sheet2!A1:H19,2,FALSE), where A1 is the employee and Sheet2A1:H19 lists employee and sales territory. Copy formula down all rows of employee names, then sort on that column, largest to smallest. Names at the top (#N/A) do not match, so hide those.
I apologize for not being more specific, I was hoping to use a macro in VBA. I have an array that has rep name in column A and the corresponding territory in column B. I currently have this:
For x = 291 To 4 Step -1
If Worksheets("Inside Analysis").Cells(x, "A").Value = Worksheets("AssignedTerr").Cells(y, "A").Value And Worksheets("Inside Analysis").Cells(y, "B").Value = Worksheets("AssignedTerr").Cells(x, "B").Value Then
Range("A" & x).EntireRow.Hidden = False
Else
Range("A" & x).EntireRow.Hidden = True
End If
Next
I basically want it to start with the name and territory in the separate sheet and cycle through the existing one to find whether or not it matches, in which case it would hide it or leave it visible.
Hope that provides a little more clarity
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks