Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Deleting duplicates within rows

I need to delete duplicate cells that occur within a row, and return only the
unique cells. There are 4 colums and almost 7000 rows.

Example of rows:
123 Main St Ste 789 123 Main St
987 Elm St 1st Floor 1st Floor Room A
311 West St 311 West St

Need to return across multiple cells:
123 Main St Ste 789
987 Elm St 1st Floor Room A
311 West St

THANKS!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Deleting duplicates within rows

In 2007
Select all columns eg a to d where d is col with duplicates
On ribbon select 'data' tab<'data tools'<'remove duplicates'<
Untick columns a, b,c in new window
Tick box for headers if appropriate
OK





"ComeOn12" wrote:

I need to delete duplicate cells that occur within a row, and return only the
unique cells. There are 4 colums and almost 7000 rows.

Example of rows:
123 Main St Ste 789 123 Main St
987 Elm St 1st Floor 1st Floor Room A
311 West St 311 West St

Need to return across multiple cells:
123 Main St Ste 789
987 Elm St 1st Floor Room A
311 West St

THANKS!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Deleting duplicates within rows

I'm sorry - I should have mentioned before that I'm using Excel 2003. Any
ideas for that?

Thanks so much!

"Arceedee" wrote:

In 2007
Select all columns eg a to d where d is col with duplicates
On ribbon select 'data' tab<'data tools'<'remove duplicates'<
Untick columns a, b,c in new window
Tick box for headers if appropriate
OK





"ComeOn12" wrote:

I need to delete duplicate cells that occur within a row, and return only the
unique cells. There are 4 colums and almost 7000 rows.

Example of rows:
123 Main St Ste 789 123 Main St
987 Elm St 1st Floor 1st Floor Room A
311 West St 311 West St

Need to return across multiple cells:
123 Main St Ste 789
987 Elm St 1st Floor Room A
311 West St

THANKS!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Deleting duplicates within rows

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim iCol As Long
Dim LastCol As Long
Dim wks As Worksheet

Set wks = Worksheets("Sheet1")

With wks
FirstRow = 1 'no headers???
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

For iRow = FirstRow To LastRow
LastCol = .Cells(iRow, .Columns.Count).End(xlToLeft).Column
For iCol = LastCol To 2 Step -1
If Application.CountIf(.Rows(iRow), _
.Cells(iRow, iCol).Value) 1 Then
'more than one found, delete this one
.Cells(iRow, iCol).Delete Shift:=xlToLeft
End If
Next iCol
Next iRow
End With
End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

ComeOn12 wrote:

I need to delete duplicate cells that occur within a row, and return only the
unique cells. There are 4 colums and almost 7000 rows.

Example of rows:
123 Main St Ste 789 123 Main St
987 Elm St 1st Floor 1st Floor Room A
311 West St 311 West St

Need to return across multiple cells:
123 Main St Ste 789
987 Elm St 1st Floor Room A
311 West St

THANKS!


--

Dave Peterson
Reply
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
Deleting rows by specified criteria for duplicates Tasha Excel Discussion (Misc queries) 4 September 9th 08 10:48 AM
Deleting Duplicates Philip Drury Excel Discussion (Misc queries) 1 October 3rd 07 06:26 PM
Deleting duplicates katana Excel Discussion (Misc queries) 4 February 7th 06 06:33 PM
Deleting Duplicates dcost@sovereignbank Excel Worksheet Functions 5 October 27th 05 02:22 AM
Deleting the first row of two duplicates. Georgyneedshelp Excel Discussion (Misc queries) 2 October 19th 05 04:44 PM


All times are GMT +1. The time now is 03:11 AM.

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

About Us

"It's about Microsoft Excel"