PDA

View Full Version : copying word from a table to another and deleting doubles



etusch
01-11-2017, 12:15 PM
18001
Hı.
I neet to copy words from table one to the table two (which is shown lower side of the picture ) At first table there could be same word many time in different rows. But I need to delete doubles in second table. After deleting doubles I need to sort them alphabetically. I am not programer. I googled for codes and found a way to copy from first table to second. But I can't find a way to delete doubles and sort.
Here my copying code

Sub deneme()
Dim myCells As Range
With ActiveDocument
Set myCells = .Range(Start:=.Tables(1).Cell(1, 4).Range.Start, End:=.Tables(1).Cell(4, 4).Range.End)
myCells.Select
Selection.Copy

End With

ActiveDocument.Tables(2).Cell(Row:=1, Column:=1).Range.Text = "Dağıtım:"
ActiveDocument.Tables(2).Cell(Row:=2, Column:=1).Range.Text = myCells + "etuusch"
'Selection.Paste
End Sub

gmaxey
01-11-2017, 04:01 PM
You are going to have to do a little better explaining exactly what you want. Dağıtım doesn't appear in the first table at all. Show an example of before and after the macro is run.

etusch
01-12-2017, 03:04 PM
this is page after macro run.
18018
dağıtım part is not important. I want to delete doublicated items in second row and sort items in alphabetic order.

gmaxey
01-13-2017, 07:32 AM
The example you offer as "after the macro runs" contains duplicated words and is not sorted in any apparent order.