i have a range containing the following strings:
step_1, step_10, step_3, step_2
using the following code
input_sh.Activate
With ActiveSheet
thanks every one for you contribution. to user I found my solution before reading your suggestion. thanks anyway for your effort
my solution:
I would separate the number into another column, your last + 1, using mid function and sort on that.
Edit: I'm not at my pc but I think your only way to do this is to setup a macro that:
Your strings have underscore followed by numbers. if that is going to be format of your string you can simply split your string using convert text to columns using "_" as your delimiter. Later you can sort and concatenate to get your sorted list of strings.
Sub Sample()
Columns(1).Copy Columns(3)
Columns("C:C").Select
Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, Other:=True, OtherChar:="_", FieldInfo:=Array(Array(1, 1), Array(2, 1))
Columns("D:D").Sort Range("D1")
i = 1
Do While Not IsEmpty(Range("C" & i))
Range("B" & i) = Range("C" & i) & "_" & Range("D" & i)
i = i + 1
Loop
End Sub