LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default Excel alphanumberic sort

Hello,

If your data is in column A starting from row 2 then enter into
B2:
=regexpreplace($A2,"^(\D*)(\d+)(.*)$","$1")
C2:
=--regexpreplace($A2,"^(\D*)(\d+)(.*)$","$2")
D2:
=regexpreplace($A2,"^(\D*)(\d+)(.*)$","$3")
copy down as far as necessary and sort by columns C, B and D

Regards,
Bernd

PS: [not my invention:]
Function RegExpReplace(ByVal SourceString As String, _
ByVal Pattern As String, ByVal ReplaceString As String, _
Optional ByVal IgnoreCase As Boolean = False, _
Optional ByVal GlobalReplace As Boolean = False, _
Optional ByVal MultiLine As Boolean = False) As String

Dim objRE As Object

Set objRE = CreateObject("vbscript.regexp")
objRE.Pattern = Pattern
objRE.IgnoreCase = IgnoreCase
objRE.Global = GlobalReplace
objRE.MultiLine = MultiLine

RegExpReplace = objRE.Replace(SourceString, ReplaceString)
Set objRE = Nothing
End Function

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort from SQL view does not sort in EXCEL Pat M - City of Reno Excel Discussion (Misc queries) 0 August 31st 07 07:38 PM
Does Excel support Alphanumberic formulas? BryanP Man Excel Worksheet Functions 1 June 30th 06 03:14 AM
Custom Format alphanumberic value with spaces Bruce Excel Worksheet Functions 2 November 28th 05 12:04 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
Excel Sort function should not sort the cell formatting! Lisa D.N.1 Excel Worksheet Functions 1 December 28th 04 08:37 PM


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"