The VBA below can order according to comma:
a,c,e,b,dPlease Login or Register to view this content.
to
a,b,c,d,e
How to revise VBA so that it can order within bracket:
a,c(b,c,a),e,b,d
to
a,b,c(a,b,c),d,e
The VBA below can order according to comma:
a,c,e,b,dPlease Login or Register to view this content.
to
a,b,c,d,e
How to revise VBA so that it can order within bracket:
a,c(b,c,a),e,b,d
to
a,b,c(a,b,c),d,e
Will the bracket set always stay with the preceding letter; "c" in your example?
Can there be more than one bracket set?
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
The bracket will be set with any letter or word and more than one bracket set:
a,c,boy and girl(C-2,c-3,c-1),e,d(2,5,4)
to
a,boy and girl(c-1,C-2,c-3),c,d(2,4,5),e
The aim is to order the words within bracket first;
and then order according to comma.
Here is one way.
In your examples you are not doing a case sensitive check. The function has parameters to handle sort order and type of comparison.Please Login or Register to view this content.
Try this code
Sub SplitAndJoin()
Please Login or Register to view this content.
Pl note
Array formula should be confirmed with Ctrl+Shift+Enter keys together.
If answere is satisfactory press * to add reputation.
Thanks Andy Pope and kvsrinivasamurthy, both of yours are works.
I have revised kvsrinivasamurthy's VBA so that it can apply to any cells (refer '<<<):
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks