Hi,
I have the below code - which sorts column B ascending alphabetically. As an example column B has heading called 'Country';
ActiveSheet.UsedRange.Sort Key1:=Range("B1"), Header:=xlYes
However the above doesn't work in instances where 'Country' column doesn't appear in column B (It could for example appear in column F).
Is there a code that will sort alphabetically by the country column regardless of which column number it appears in?
Thanks
I have the below code - which sorts column B ascending alphabetically. As an example column B has heading called 'Country';
ActiveSheet.UsedRange.Sort Key1:=Range("B1"), Header:=xlYes
However the above doesn't work in instances where 'Country' column doesn't appear in column B (It could for example appear in column F).
Is there a code that will sort alphabetically by the country column regardless of which column number it appears in?
Thanks