Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to append and remove dups
hi!
I have the following spreadsheet: columna columnb columnc columnd 1 AAAA BCBCBC xyxyxy 1 AAAA DEDEDE sdsdw 2 DDDDD ghjhedt jhughu 2 DDDDD null yujhgf 3 EEEEEE null ptyergh I need to append the data from columnc and columnd if the columna number is the same. e.g. columna columnb columnc columnd 1 AAAA BCBCBC,DEDEDE xyxyxy,sdsdw 2 DDDDD ghjhedt,null jhughu,yujhgf 3 EEEEEE null ptyergh I have the following code, but it only works for one column of appending data. How can I modify so that it does it on the 2 columns I need. Also how can I check for last row in spreadhseet instead of having to manually hard code the last row used? Thanks a lot for your help!!!!! Tammy Sub RemoveDuplicates() For Row = 267 To 2 Step -1 If Cells(Row, "A").Value = Cells(Row - 1, "A").Value Then s = s & RTrim(LTrim(Cells(Row, "J").Value)) & ";" Rows(Row).Delete Else If s < "" Then Cells(Row, "J").Value = s & Cells(Row, "J").Value s = "" End If End If Next Row End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Append values and remove text | Excel Worksheet Functions | |||
Delete Dups | Excel Discussion (Misc queries) | |||
Please help. Remove dups automaic of same name,price,month. | Excel Discussion (Misc queries) | |||
database - looking for dups | Excel Discussion (Misc queries) | |||
Dups from 2 worksheets | Excel Worksheet Functions |