Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
Is there a specific code that i can use to remove duplicates from a list. I
want to be able to do this using code rather than manually so that when I copy in a large list of data I can make a copy of one of the columns and remove the duplicates from this and paste it on another worksheet of the workbook. Thank you very much for your help, Michelle |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
Hi,
Use an advanced filter but to copy to another sheet you must start from that sheet or you will get an error. So on the destination sheet data|Filter - Advanced filter - select copy to another location Click the box to the right of 'List Range' and navigate to your data and select it all Check unique records only Click the box to the right of 'Copy To' and select a single cell to copy the unique list to OK -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "michelle439731" wrote: Is there a specific code that i can use to remove duplicates from a list. I want to be able to do this using code rather than manually so that when I copy in a large list of data I can make a copy of one of the columns and remove the duplicates from this and paste it on another worksheet of the workbook. Thank you very much for your help, Michelle |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
See my solution to a posting last week http://tinyurl.com/yd2a25c -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=183462 Microsoft Office Help |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
Yes, that is what I want to do. Look at column B, which contains duplicates,
copy all unique parameters to column C, such that column C contains no duplicates. How do I do that in code? What is the command? Thank you very much for your help, Michelle |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
Hi,
Try this macro. Alt+F11 to open VB editor. Right click 'ThisWorkbook' and insert module and paste the code in and run it. Change the sheet name to the correct one. Sub Copy_B_To_C() Dim ws As Worksheet Set ws = ThisWorkbook.Worksheets("Sheet1") With ws .Columns("B:B").AdvancedFilter Action:=xlFilterCopy, _ CopyToRange:=.Range("C1"), Unique:=True End With End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "michelle439731" wrote: Yes, that is what I want to do. Look at column B, which contains duplicates, copy all unique parameters to column C, such that column C contains no duplicates. How do I do that in code? What is the command? Thank you very much for your help, Michelle |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
I'll try it out.
Thank you! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove duplicates from list using code
I'll try it out.
Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove duplicates found in master list | Excel Discussion (Misc queries) | |||
Remove Duplicates; How can I get a list of items removed? | Excel Discussion (Misc queries) | |||
Remove duplicates from list but leaving one row with highest date | Excel Programming | |||
How to remove duplicates from a list and copy new list to new colu | Excel Worksheet Functions | |||
dynamic list to remove duplicates and spaces ? | Excel Programming |