Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Indicate Duplicate Entries Across Multiple Columns | Excel Discussion (Misc queries) | |||
DELET PERTICULER WORD FROM THE EXCEL SHEET | Excel Worksheet Functions | |||
How to delet browsed pages list from the insert hyperlink | Excel Discussion (Misc queries) | |||
how do I lock formulas, but still allow rows to be added or delet. | Excel Worksheet Functions | |||
Combine Multiple Entries with differing amounts of entries | Excel Worksheet Functions |