H
Howard
This works fine except the I would prefer NOT to have the last ;
Takes this:
A;C;B;N;M;Z;V
And returns this:
A;B;C;M;N;V;Z;
A nasty little semi colon at the end.
Thanks,
Howard
Option Explicit
Sub Sort_And_Stuff()
Dim rngC As Range
Range("A2").TextToColumns Destination:=Range("B1"), _
DataType:=xlDelimited, Semicolon:=True
ActiveSheet.Range("B1", ActiveSheet.Range("B1").End(xlToRight)).Sort _
Key1:=Range("B1"), Order1:=xlAscending, Orientation:=xlLeftToRight
For Each rngC In ActiveSheet.Range("B1", ActiveSheet.Range("B1").End(xlToRight))
Range("B2") = IIf(Len(rngC) = 0, Range("B2"), Range("B2") & rngC.Text) & ";"
Next
MsgBox Len(Range("B2").Value)
ActiveSheet.Range("B1", ActiveSheet.Range("B1").End(xlToRight)).ClearContents
End Sub
Takes this:
A;C;B;N;M;Z;V
And returns this:
A;B;C;M;N;V;Z;
A nasty little semi colon at the end.
Thanks,
Howard
Option Explicit
Sub Sort_And_Stuff()
Dim rngC As Range
Range("A2").TextToColumns Destination:=Range("B1"), _
DataType:=xlDelimited, Semicolon:=True
ActiveSheet.Range("B1", ActiveSheet.Range("B1").End(xlToRight)).Sort _
Key1:=Range("B1"), Order1:=xlAscending, Orientation:=xlLeftToRight
For Each rngC In ActiveSheet.Range("B1", ActiveSheet.Range("B1").End(xlToRight))
Range("B2") = IIf(Len(rngC) = 0, Range("B2"), Range("B2") & rngC.Text) & ";"
Next
MsgBox Len(Range("B2").Value)
ActiveSheet.Range("B1", ActiveSheet.Range("B1").End(xlToRight)).ClearContents
End Sub