Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
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

Re: How to sort some numbers into line?   
Thank you very much!
date: Fri, 26 Sep 2008 08:38:56 -0700 (PDT)   author:   avkokin

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us