S
Steve Muir
I am new to VBA/Macros and really don't know how to get this to work.
I have a spreadsheet which calculates distances between two postcodes for a
list of suppliers. Each supplier can have one or more branches at different
locations (postcodes). I need to return only the closest branch of each
supplier (i.e. copy the row of the closest supplier to a new sheet.
The sheet has 6 columns. Only 2 of these columns are needed to work out
this problem.
Column A holds the Supplier Name and Column F holds the distance from us.
I have worked out the steps needed to complete this, they are:
1. Loop through Column A
2. If only 1 instance of the Supplier Name then copy this row to new sheet.
3. If more than 1 instance, then loop through column F (Distance field) and
find the row which has the lowest distance value and copy this row to the new
sheet.
If anyone can at least point me in the right direction I will try my best to
write this myself. I managed to write (well, adapt really!) the code which
works out the distance but this is a little beyond my current skills.
Many thanks
Stephen
I have a spreadsheet which calculates distances between two postcodes for a
list of suppliers. Each supplier can have one or more branches at different
locations (postcodes). I need to return only the closest branch of each
supplier (i.e. copy the row of the closest supplier to a new sheet.
The sheet has 6 columns. Only 2 of these columns are needed to work out
this problem.
Column A holds the Supplier Name and Column F holds the distance from us.
I have worked out the steps needed to complete this, they are:
1. Loop through Column A
2. If only 1 instance of the Supplier Name then copy this row to new sheet.
3. If more than 1 instance, then loop through column F (Distance field) and
find the row which has the lowest distance value and copy this row to the new
sheet.
If anyone can at least point me in the right direction I will try my best to
write this myself. I managed to write (well, adapt really!) the code which
works out the distance but this is a little beyond my current skills.
Many thanks
Stephen