+ Reply to Thread
Results 1 to 3 of 3

Hiding duplicates but displaying 1 of the duplicates item

Hybrid View

  1. #1
    Registered User
    Join Date
    01-18-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    35

    Hiding duplicates but displaying 1 of the duplicates item

    We have a workbook that allow us to select a switchboard (In green box) in the "On Air Notice" sheet and it will display a list of items from "Fire Mode" sheet. What we would like to do now is when it displays the list of items on the "Air On Notice" sheet it automatically hides duplicates but displays 1 of the duplicate item. Duplicates filter items to be picked from is "Unit Number" under the A & B column. We need to group the "A & B" columns together and if it finds a duplicate it only shows 1 item regardless of how many duplicates there are. Is this possible? I have attached our workbook to make it easier to understand.


    Commissioning Test_3.xlsm

    R

    CB

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Hiding duplicates but displaying 1 of the duplicates item

    Try this:-
    Sub MG19Apr00
    Dim Rng         As Range
    Dim Dn          As Range
    Dim Twn         As String
    Dim nRng        As Range
    With Sheets("On Air Notice")
        Set Rng = .Range(.Range("A1"), .Range("A" & Rows.Count).End(xlUp))
    End With
        With CreateObject("scripting.dictionary")
            .CompareMode = vbTextCompare
    For Each Dn In Rng
        Twn = Dn & Dn.Offset(, 1)
            If Not .Exists(Twn) Then
                .Add Twn, Dn
            Else
                If nRng Is Nothing Then
                    Set nRng = Dn
                Else
                    Set nRng = Union(nRng, Dn)
                End If
            End If
    Next
    If Not nRng Is Nothing Then nRng.EntireRow.Hidden = True
    End With
    
    End Sub
    Regards Mick

  3. #3
    Registered User
    Join Date
    01-18-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Hiding duplicates but displaying 1 of the duplicates item

    Thanks Mick worked perfectly

    R

    CB

+ 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