Results 1 to 10 of 28

Thread: Remove Duplicates From Across Multipe Columns In A Single WorkSheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #19
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    13
    assumptions:

    - data in sheet1
    - row 1 doesn't contain fieldnames
    - no empty rows in the usedrange
    - 17 columns that contain data

    Code:
    Sub M_snb()
      sn=sheet1.cells(1).currentregion.resize(,17)
    
      with createobject("scripting.dictionary")
         for j=1 to ubound(sn)
           .item(join(application.index(sn,j,0)))=application.index(sn,j,0)
         next
         sheet2.cells(1).resize(.count,17)=application.index(.items,0,0)
      end with
    End Sub
    or another method

    Code:
    Sub M_snb()
      sn=sheet1.cells(1).currentregion.resize(,17)
      c00=""
    
     for j=1 to ubound(sn)
        if instr(c00 & "|" ,"|" & application.index(sn,j,0) & "|") then 
         sn(j,1)=""
        else
         c00=c00 & "|" & application.index(sn,j,0)
        end if
      next
    
      sheet1.cells(1).currentregion.resize(,17)=sn
      sheet1.columns(1).specialcells(4).entirerow.delete
    End Sub
    Last edited by snb; 10-27-2013 at 09:34 PM.

Similar Threads

  1. Find Duplicates, 2 Columns, Different Worksheets
    By ghendi in forum Excel Help
    Replies: 14
    Last Post: 07-17-2013, 04:26 AM
  2. Remove Special Characters From Text Or Remove Numbers From Text
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 5
    Last Post: 05-31-2013, 04:43 PM
  3. Print Nth Worksheet To Mth Worksheet using VBA
    By Ryan_Bernal in forum Excel Help
    Replies: 2
    Last Post: 02-28-2013, 06:57 PM
  4. Converge Data From Multiple Columns To Single Column
    By ayazgreat in forum Excel Help
    Replies: 3
    Last Post: 12-14-2012, 10:55 PM
  5. Detect Duplicates In Named Ranges With Cross Check
    By Yegarboy in forum Excel Help
    Replies: 3
    Last Post: 10-09-2012, 11:02 AM

Posting Permissions

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