![]() |
Sorting by number of characters
I am using Excel 2007
(thought I posted this earlier, but can't find it - even with google group search). I need to sort an inventory list according to the number of characters in the item number (not by numerals). Is this possible? Thanks! Nicole |
Sorting by number of characters
May be this...
=LEN(A1) Change the A1 to your Item Number Cell. Remember to Click Yes, if this post helps! -------------------- (Ms-Exl-Learner) -------------------- "NicoleS" wrote: I am using Excel 2007 (thought I posted this earlier, but can't find it - even with google group search). I need to sort an inventory list according to the number of characters in the item number (not by numerals). Is this possible? Thanks! Nicole |
Sorting by number of characters
In a spare column you can put this on row 2:
=LEN(A2) and copy down. Include this column within the sort area, and sort on this new column. Hope this helps. Pete On May 13, 5:51*pm, NicoleS wrote: I am using Excel 2007 (thought I posted this earlier, but can't find it - even with google group search). I need to sort an inventory list according to the number of characters in the item number (not by numerals). Is this possible? Thanks! Nicole |
Quote:
Sub SortByLength() Range("A:A").EntireColumn.Insert With Range("B2", Cells(Rows.Count, "B").End(xlUp)).Offset(0, -1) .FormulaR1C1 = "=LEN(RC[1])" .Value = .Value End With Range("A2", Cells(Rows.Count, "B").End(xlUp)).Sort _ Key1:=Range("B2"), Order1:=xlDescending, Header:=xlYes Range("A:A").EntireColumn.Delete End Sub |
All times are GMT +1. The time now is 06:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com