Forum Discussion
Makoman295
Sep 27, 2022Copper Contributor
Trying to organize by numbers in excel
Hello, I've been searching around for a while now but I can't seem to find the answer or I'm just doing it wrong. I'm trying to sort a column I have listed like I5, I6, I7, I8, I13, I16, I17, I18 and...
alannavarro
Sep 28, 2022Iron Contributor
Makoman295 I think there might be a simple solution with lambda or dynamic arrays, here is something that I found online, it works with vba, is going to create a function called "num" that is going to create an index starting from 1 for the range you select. Attached is an example.
https://www.extendoffice.com/documents/excel/3451-excel-sort-numbers-with-text-alpha-text-prefix-suffix.html
Function num(rng As Range) As Integer
Dim n As Integer
For n = 1 To Len(rng)
If Mid(rng, n, 1) Like "[0-9]" Then
num = num & Mid(rng, n, 1)
End If
Next n
End Function