|
|
|
date: Fri, 26 Sep 2008 06:39:45 -0700 (PDT),
group: microsoft.public.word.vba.general
back
How to sort some numbers into line?
Hello.
There is the string with the some numbers (63, 53a, 67, 73b, 75A, 69,
69c, 79n, 75b, 73C, 69a) into one line.
How to sort this numbers?
Thank you very much.
date: Fri, 26 Sep 2008 06:39:45 -0700 (PDT)
author: avkokin
Re: How to sort some numbers into line?
If the string of numbers is alone on the line then
Dim oRng As Range
With Selection
.HomeKey wdLine
.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Set oRng = .Range
End With
oRng.End = oRng.End - 1
oRng = Replace(oRng, ", ", Chr(13))
oRng.Sort ExcludeHeader:=False, FieldNumber:="Paragraphs", _
SortFieldType:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending
oRng = Replace(oRng, Chr(13), ", ")
should work
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
avkokin wrote:
> Hello.
> There is the string with the some numbers (63, 53a, 67, 73b, 75A, 69,
> 69c, 79n, 75b, 73C, 69a) into one line.
> How to sort this numbers?
> Thank you very much.
date: Fri, 26 Sep 2008 17:31:07 +0300
author: Graham Mayor
|
|