-
As a convenient function, paste the code in a standard module and enter =SortIt(A1) in a cell.
[vba]
Function SortIt(Data As Range)
Dim ary1
ary1 = Split(Replace(Data, ",", ""), " ")
SortIt = ary1(1) & " " & ary1(0) & ", " & ary1(2)
End Function
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules