Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default delet multiple entries on same row(different columns)

my data has duplicates in some rows that I need to get rid of, below is an
example.
look at the first row below in my example, it needs to be as follows:
057330 0257015 0257020 0257065

Example:
0573300 0257015 0257015 0257020 0257020 0257065 0257065
0573300 0257015 0257020 0257065 0257070 0257099 0280346
0573300 0257015 0257020 0257065 0257070 0257099 0280346
0573001 0573001 0573001 0271596 0271539 0271539 0273410
0573300 0257020 0257065 0257015 0257070 0257099 0280346
0573300 0573300 0257020 0272950 0271518 0279710 0642718


--
clcnewtoaccess
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default delet multiple entries on same row(different columns)


Try some code like the following

Sub AAA()

Dim CNdx As Long
Dim RNdx As Long
Dim WS As Worksheet

Set WS = ActiveSheet
RNdx = 1 '<< CHANGE TO START ROW
With WS
Do Until .Cells(RNdx, 1).Value = vbNullString
CNdx = .Cells(RNdx, .Columns.Count).End(xlToLeft).Column
Do Until CNdx = 1
If Application.CountIf(.Cells(RNdx, 1).Resize(1, CNdx), _
.Cells(RNdx, CNdx)) 1 Then
.Cells(RNdx, CNdx).Delete shift:=xlToLeft
End If
CNdx = CNdx - 1
Loop
RNdx = RNdx + 1
Loop
End With
End Sub


Change RNdx = 1 to the appropriate starting row number. The code will
process each row, deleting duplicates, until a blank cell is
encountered in column A.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 9 Feb 2009 11:49:01 -0800, clcnewtoaccess
wrote:

my data has duplicates in some rows that I need to get rid of, below is an
example.
look at the first row below in my example, it needs to be as follows:
057330 0257015 0257020 0257065

Example:
0573300 0257015 0257015 0257020 0257020 0257065 0257065
0573300 0257015 0257020 0257065 0257070 0257099 0280346
0573300 0257015 0257020 0257065 0257070 0257099 0280346
0573001 0573001 0573001 0271596 0271539 0271539 0273410
0573300 0257020 0257065 0257015 0257070 0257099 0280346
0573300 0573300 0257020 0272950 0271518 0279710 0642718

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
Indicate Duplicate Entries Across Multiple Columns Cameron Excel Discussion (Misc queries) 6 January 17th 09 01:23 AM
DELET PERTICULER WORD FROM THE EXCEL SHEET Amit Excel Worksheet Functions 2 September 15th 08 02:43 PM
How to delet browsed pages list from the insert hyperlink Freeman_2010 Excel Discussion (Misc queries) 2 July 5th 08 02:57 PM
how do I lock formulas, but still allow rows to be added or delet. ericaamousseau Excel Worksheet Functions 3 January 18th 08 08:10 PM
Combine Multiple Entries with differing amounts of entries Katie Excel Worksheet Functions 2 November 28th 07 10:53 PM


All times are GMT +1. The time now is 04:21 PM.

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"