Alphabetize with commas?

K

kevs

I want a bunch of words to be alphabetized separated with commas in a Word
file. Should I get the words first in excel, or can word do this? And can
excel or either do this and how? Thanks.




OS 10.4.7
Office 2004
 
B

Bob Greenblatt

I want a bunch of words to be alphabetized separated with commas in a Word
file. Should I get the words first in excel, or can word do this? And can
excel or either do this and how? Thanks.




OS 10.4.7
Office 2004
If these words are in a cell, then use text to columns from the data menu to
separate them. Then sort the result. You can then use a simple formula such
as = a1&", "&b1&", "&c1 etc to put them back into a single cell.
 
M

Maggi V-W

Bob said:
If these words are in a cell, then use text to columns from the data menu to
separate them. Then sort the result. You can then use a simple formula such
as = a1&", "&b1&", "&c1 etc to put them back into a single cell.

Personally, I think it is easier with Word: Put one word on each line,
alphabetize with the table sort, then do a search-and-replace of the
hard return and replace it with a comma and a space.
 
K

kevs

If these words are in a cell, then use text to columns from the data menu to
separate them. Then sort the result. You can then use a simple formula such
as = a1&", "&b1&", "&c1 etc to put them back into a single cell.
Thanks Bob,
So used to sorting rows, how do you sort columns?

OS 10.4.7
Office 2004
 
B

Bob Greenblatt

Thanks Bob,
So used to sorting rows, how do you sort columns?

OS 10.4.7
Office 2004
Either select a single row, or go to Options in the sort dialog and Select
Sort left to right.
 
K

kevs

Either select a single row, or go to Options in the sort dialog and Select
Sort left to right.

Ok Bob that soft left to rights works. But is there a quick way then to get
them (80words in their own columns) back onto a word page separated by
commas?

OS 10.4.7
Office 2004
 
B

Bob Greenblatt

Ok Bob that soft left to rights works. But is there a quick way then to get
them (80words in their own columns) back onto a word page separated by
commas?

OS 10.4.7
Office 2004
Here is a little macro that will collect all the values in cells to its
right as a comma delimited string:

Sub CollectWords()
Dim i As Integer
Dim s As String
With ActiveCell
For i = 1 To 255 - .Column
s = .Offset(0, i)
If Len(s) > 0 Then .Value = .Value & "," & s
Next
.Value = Right(.Value, Len(.Value) - 1)
End With
End Sub
 
K

Ken Weingart

Here is a little macro that will collect all the values in cells to its
right as a comma delimited string:

Sub CollectWords()
Dim i As Integer
Dim s As String
With ActiveCell
For i = 1 To 255 - .Column
s = .Offset(0, i)
If Len(s) > 0 Then .Value = .Value & "," & s
Next
.Value = Right(.Value, Len(.Value) - 1)
End With
End Sub
Thanks bob, I'll hang onto this.

OS 10.4.7
Office 2004
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top