PDA

View Full Version : Problem



parscon
03-08-2012, 03:13 PM
I have 5 column , but in column A i have duplivate bout other coulumn in same row have diffrent data , i want merge data to one and elete other dupicate in column A , also i have some sheet check all sheet and merge duplicated after that them delete them . please check the attchment you will understand what i need . I need this really , please help me .

Bob Phillips
03-08-2012, 03:25 PM
Public Sub ProcessData()
Dim lastrow As Long
Dim i As Long

With ActiveSheet

lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = lastrow To 2 Step -1

If .Cells(i, "A").Value = .Cells(i - 1, "A").Value Then

.Cells(i - 1, "B").Value = .Cells(i - 1, "B").Value & "-" & _
.Cells(i, "B").Value
.Cells(i - 1, "C").Value = .Cells(i - 1, "C").Value & "-" & _
.Cells(i, "C").Value
.Cells(i - 1, "D").Value = .Cells(i - 1, "D").Value & "-" & _
.Cells(i, "D").Value

.Rows(i).Delete
End If
Next i
End With
End Sub

parscon
03-08-2012, 03:27 PM
THank you very much . I have another problem , i have these data on diffrent sheet , is it possible check all sheet ?

Thank you so much .

Bob Phillips
03-08-2012, 03:47 PM
That is odd, they all looked to be on the same sheet in the example you gave here.

parscon
03-08-2012, 03:49 PM
that mean it is not possible to check all sheet and merge them and delete them duplicated ?

sorry for my bad english .

parscon
03-08-2012, 03:54 PM
Also i have another problem , i have duplicated number in A but they are not sort , for example in column A1 , i have 1 and in cloumn A6 i have the same number that mean 1 , but it will not merge .

parscon
03-10-2012, 05:18 AM
Dear XLD Please help me this on this subject ,

Thank you .