Hi Guys! I have the code below to sort my table, but this sheet is downloaded from a system and the columns change position from time to time.
Is there a way to execute the code below using header's names?
Like this:
I've been reading this forum for a long time, but this is my first post!
I'd a research and haven't find anything.
I really appreciate any help you can provide.
Is there a way to execute the code below using header's names?
Code:
Range("A1").CurrentRegion.Sort _
key1:=Range("AY1"), Order1:=xlAscending, _
key2:=Range("AZ1"), order2:=xlAscending, _
key3:=Range("BV1"), order3:=xlAscending, _
Header:=xlYes
Like this:
Code:
Range("A1").CurrentRegion.Sort _
key1:=Range("[B]CPO Number[/B]"), order1:=xlAscending, _
key2:=Range("[B]CPO Item[/B]"), order2:=xlAscending, _
key3:=Range("[B]Invoice Number[/B]"), order3:=xlAscending, _
Header:=xlYes
I've been reading this forum for a long time, but this is my first post!
I'd a research and haven't find anything.
I really appreciate any help you can provide.