Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
toyota58
 
Posts: n/a
Default Digits in ascending order ?

Hello,


Anyone knows how to sort digits in ascending order ?


Example :

Cell A1 = 3176
Cell A2 = 1367


Cell A1 = 704182
Cell A2 = 012478



Thank You.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Digits in ascending order ?

Hello,

I suggest to take this UDF:

Option Explicit

Function sort_digits(s As String) As String
Dim a(0 To 9) As Long, i As Long

For i = 1 To Len(s)
a(Mid(s, i, 1)) = a(Mid(s, i, 1)) + 1
Next i

For i = 0 To 9
sort_digits = sort_digits & String(a(i), Chr(Asc("0") + i))
Next i

End Function

HTH,
Bernd

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
toyota58
 
Posts: n/a
Default Digits in ascending order ?

Thank You so much...

Reply
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
Pivot Table Ascending Order of Row Field ExcelMonkey Excel Discussion (Misc queries) 1 August 19th 05 12:11 AM
Changing the auto fill order from ascending to descending Dave C. Excel Discussion (Misc queries) 9 April 26th 05 06:39 PM
sorting number in ascending order Janice Lee via OfficeKB.com Excel Discussion (Misc queries) 2 April 8th 05 10:31 PM
graph displayed in ascending order of value? [email protected] Charts and Charting in Excel 3 January 7th 05 04:21 AM
Graph values in ascending order Ant [email protected] Excel Discussion (Misc queries) 1 January 6th 05 06:10 PM


All times are GMT +1. The time now is 12:51 PM.

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

About Us

"It's about Microsoft Excel"