+ Reply to Thread
Results 1 to 3 of 3

Hide Rows by referring to separate sheet

  1. #1
    Registered User
    Join Date
    06-14-2011
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    7

    Hide Rows by referring to separate sheet

    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!

  2. #2
    Forum Contributor
    Join Date
    10-16-2008
    Location
    Iowa
    Posts
    121

    Re: Hide Rows by referring to separate sheet

    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.

  3. #3
    Registered User
    Join Date
    06-14-2011
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Hide Rows by referring to separate sheet

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1