I would do it as follows:
First copy the data from Word into Excel. Then run the following macro:
Sub main()
Dim wb As Excel.Workbook, wsFrom As Excel.Worksheet, wsTo As
Excel.Worksheet, rngFrom As Excel.Range, rngTo As Excel.Range
Dim NO_OF_RECORDS As Integer
Set wb = ThisWorkbook
Set wsFrom = wb.Sheets("Sheet1") 'This contains the addresses
Set wsTo = wb.Sheets("Sheet2") 'That's where the data is going to be
copied to
Set rngFrom = wsFrom.Range("A1")
Set rngTo = wsTo.Range("A1")
NO_OF_RECORDS = 1000 'adjust as necessary
transpose rngFrom, rngTo, NO_OF_RECORDS, 1, 0
Set wsFrom = wb.Sheets("Sheet2")
Set wsTo = wb.Sheets("Sheet3")
Set rngFrom = wsFrom.Range("A1")
Set rngTo = wsTo.Range("A1")
'transpose rngFrom, rngTo, NO_OF_RECORDS, 0, 1
Set wb = Nothing
Set wsFrom = Nothing
Set wsTo = Nothing
Set rngFrom = Nothing
Set rngTo = Nothing
End Sub
Sub transpose(ByVal rngFrom As Range, ByVal rngTo As Range, ByVal
NO_OF_RECORDS As Integer, ByVal r As Integer, ByVal c As Integer)
Dim colFrom As Integer, rowFrom As Integer, colTo As Integer, rowTo As
Integer
Dim i As Integer, tmp As String
colFrom = 1
rowFrom = 1
colTo = 1
rowTo = 1
For i = 1 To NO_OF_RECORDS
While (rngFrom.Value <> "")
rngTo.Value = rngFrom.Value
Set rngFrom = rngFrom.offset(r, c)
Set rngTo = rngTo.offset(c, r)
Wend
Set rngFrom = rngFrom.offset(1, -(rngFrom.Column - 1))
Set rngTo = rngTo.offset(1, -(rngTo.Column - 1))
Next i
End Sub
This transposes rows in Sheet1 to columns in Sheet2. Sort them, delete
duplicates, and rerun macro with the first call to transpose commented
out and the second one uncommented.
Let me know if this helps.
Regards,
Steve