harrysolomon
New Member
- Joined
- Mar 6, 2002
- Messages
- 25
I have an Excel worksheet which contains an ISO Country Code value in a cell and then the next cell to the right contains the Country name corresponding to that ISO Country code.
For example, cell A1 contains the value "US" and cell B1 contains the name "United States”, cell C1 contains "CH" and cell D1 contains "Switzerland", cell E1 contains “DE” and cell F1 contains “Germany” .
This country code & description information exists across a single row and the number of cells on a row which contain a value will vary.
The information listed across the row is currently sorted in alphabetical order on the ISO Country Code value and I want to re-sort this information alphabetically within the row by the ISO Code description using VBA.
So using the previous example data, if the original order of the data in the row is
cell A1 = "US" & cell B1 = "United States”
cell C1 = “CH” & cell D1 = “Switzerland”
cell E1 = "DE" & cell F1 = "Germany"
After sorting, the desired end result should be
cell A1 = "DE" & cell B1 = "Germany"
cell C1 = “CH” & cell D1 = “Switzerland”
cell E1 = "US" & cell F1 = "United States”
Thanks in advance for any help.
For example, cell A1 contains the value "US" and cell B1 contains the name "United States”, cell C1 contains "CH" and cell D1 contains "Switzerland", cell E1 contains “DE” and cell F1 contains “Germany” .
This country code & description information exists across a single row and the number of cells on a row which contain a value will vary.
The information listed across the row is currently sorted in alphabetical order on the ISO Country Code value and I want to re-sort this information alphabetically within the row by the ISO Code description using VBA.
So using the previous example data, if the original order of the data in the row is
cell A1 = "US" & cell B1 = "United States”
cell C1 = “CH” & cell D1 = “Switzerland”
cell E1 = "DE" & cell F1 = "Germany"
After sorting, the desired end result should be
cell A1 = "DE" & cell B1 = "Germany"
cell C1 = “CH” & cell D1 = “Switzerland”
cell E1 = "US" & cell F1 = "United States”
Thanks in advance for any help.