LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove duplicates found in master list Mike Excel Discussion (Misc queries) 2 December 13th 07 04:22 PM
Remove Duplicates; How can I get a list of items removed? Kjenkins Excel Discussion (Misc queries) 2 June 19th 07 10:57 PM
Remove duplicates from list but leaving one row with highest date [email protected] Excel Programming 6 November 7th 06 10:45 AM
How to remove duplicates from a list and copy new list to new colu Chance Excel Worksheet Functions 2 April 23rd 05 05:21 AM
dynamic list to remove duplicates and spaces ? Keith[_13_] Excel Programming 4 June 29th 04 01:38 AM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"