Reputation: 43
I am a beginner in VBA and I tried to do a specific sort after an aplhebitical sort.
Initially all data are shuffled and I applyed a sort to sort by alphabetical order with the following code:
Range ("A1", Range("A1").End(xlDwn)).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
Please find below the first column of my excel sheet after the alphabetical sort.
Column A
String_Atest_1
String_Btest_2
String_C60_APT
String_C60_BLD
String_C60_FUD
String_C60_TED
String_C63_APT
String_C63_BLD
String_C63_FUD
String_C63_TED
String_C64_APT
String_C64_BLD
String_C64_FUD
String_C64_TED
...
But my goal is to do an alphabetical sort with this specific order : FUD, TED, BLD, APT
.
So the excepted result is:
Column A
String_Atest_1
String_Btest_2
String_C60_FUD
String_C60_TED
String_C60_BLD
String_C60_APT
String_C63_FUD
String_C63_TED
String_C63_BLD
String_C63_APT
String_C64_FUD
String_C64_TED
String_C64_BLD
String_C64_APT
...
Someone can help me to do this please? Thanks a lot.
Upvotes: 2
Views: 124
Reputation: 75860
You can do this without VBA (if you want to)
FUD, Ted, BLD, APT
.You can automate this procedure through VBA, there are examples around for example here and here.
Upvotes: 1