+ Reply to Thread
Results 1 to 9 of 9

Flash each Uniqe Values from Filtered Duplicate

  1. #1
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2010
    Posts
    271

    Flash each Uniqe Values from Filtered Duplicate

    Sample Workbook attached (Should work in Excel 2007, 2010 and above)

    Shhet1 , Row B11 acts as Header, Rows 1 to 10 has some data, so Rows 1 to 11 should not be disturbed.

    I have huge data across columns so, avoid helper column.

    I seek a VBA Code that could filter duplicate data from Column B

    Having filtered duplicates as above, need to flash thorugh Message Box only unqiue cell values from Cell B12 onwards one below the other.

    Row data range could vary from B11 to couople of thousand rows.

    Thanks.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Flash each Uniqe Values from Filtered Duplicate

    If I read correctly you want a message box of unique duplicates from a filtered range

    Please Login or Register  to view this content.
    Last edited by nigelog; 02-06-2020 at 10:03 AM.

  3. #3
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2010
    Posts
    271

    Re: Flash each Uniqe Values from Filtered Duplicate

    @NIGELOG, yes, you read correctely and i just tested your code.

    I got error [variable not defined] on this line where the syntax is
    Please Login or Register  to view this content.
    which i changed to
    Please Login or Register  to view this content.
    and it works well, except,

    The MessageBox should not show HEADER1, it should display only the desired / expected result (well done here above) and also, such finding should not be be filled with color in respective Cells in respective column.

    Also, if the finding / outcome is more than 20 row items, will messagebox adjust itself in those cases ?

    If you can help me to spot on above.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    As a VBA starter demonstration just using Excel Basics like any beginner operating manually :

    PHP Code: 
    Sub Demo1()
         
    Dim V
             Sheet2
    .UsedRange.Clear
        With Sheet1
    .Range("B11:B" Sheet1.UsedRange.Rows.Count)
             
    "=COUNTIF(" & .Address(External:=True) & ",A1)=1"
            
    .AdvancedFilter xlFilterCopy, , Sheet2.[A1], True
        End With
        With Sheet2
    .UsedRange.Columns("A:B")
               .
    Item(2).Formula V
               
    .Cells(2).Clear
               
    .Sort .Cells(2), xlAscendingHeader:=xlYes
            
    If Not .Range("B2"Then
                V 
    = .Item(2).Find(False, , xlValuesxlWhole, , xlPrevious).Row
                MsgBox Join
    (.Parent.Evaluate("TRANSPOSE(A2:A" ")"), vbLf)
            
    End If
        
    End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 02-06-2020 at 11:27 AM.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Flash each Uniqe Values from Filtered Duplicate

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and add within with source block

    Please Login or Register  to view this content.
    I used the colours to identify duplicated rather than a new column

    THis works on your own workbook
    Please Login or Register  to view this content.
    Last edited by nigelog; 02-06-2020 at 12:52 PM.

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Flash each Uniqe Values from Filtered Duplicate

    Possibly...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2010
    Posts
    271

    Re: Flash each Uniqe Values from Filtered Duplicate

    Quote Originally Posted by dangelor View Post
    Possibly...
    Please Login or Register  to view this content.
    Fast execution, but i want to flash through MessageBox only Unique Values from/amongst DUPLICATES (So, idea is to have first duplicates, and then flash only each unique item from them).

  8. #8
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2010
    Posts
    271

    Re: Hi ! Try this !

    Quote Originally Posted by Marc L View Post

    As a VBA starter demonstration just using Excel Basics like any beginner operating manually :

    PHP Code: 
    Sub Demo1()
         
    Dim V
             Sheet2
    .UsedRange.Clear
        With Sheet1
    .Range("B11:B" Sheet1.UsedRange.Rows.Count)
             
    "=COUNTIF(" & .Address(External:=True) & ",A1)=1"
            
    .AdvancedFilter xlFilterCopy, , Sheet2.[A1], True
        End With
        With Sheet2
    .UsedRange.Columns("A:B")
               .
    Item(2).Formula V
               
    .Cells(2).Clear
               
    .Sort .Cells(2), xlAscendingHeader:=xlYes
            
    If Not .Range("B2"Then
                V 
    = .Item(2).Find(False, , xlValuesxlWhole, , xlPrevious).Row
                MsgBox Join
    (.Parent.Evaluate("TRANSPOSE(A2:A" ")"), vbLf)
            
    End If
        
    End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Bang on, Perfect Sir. Thanks

  9. #9
    Forum Contributor
    Join Date
    08-17-2013
    Location
    Asia
    MS-Off Ver
    Excel 2010
    Posts
    271

    Re: Flash each Uniqe Values from Filtered Duplicate

    Thanks Seniors, @nigelog, @Marc L , @dangelor

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Remove duplicate and move the filtered data to another sheet
    By juan.doe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-10-2016, 11:00 PM
  2. Countif without duplicate in filtered cells
    By nccwhk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-15-2016, 03:25 AM
  3. Counting Uniqe values with criteria
    By SFMASS in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-21-2014, 05:58 PM
  4. Replies: 0
    Last Post: 12-07-2011, 05:25 PM
  5. Hide duplicate rows from filtered data
    By Arshmaan in forum Excel General
    Replies: 2
    Last Post: 10-28-2011, 06:37 AM
  6. Pivot Table - Duplicate Columns Filtered Differently?
    By jboysen in forum Excel General
    Replies: 1
    Last Post: 07-25-2009, 12:34 AM
  7. Pull out uniqe Values.
    By Ipsl in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-31-2008, 12:18 AM

Tags for this Thread

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