LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Macro/VBA to loop through list of values and output row- Help Need

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 a
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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
create loop in macro for a list VAMS Excel Programming 3 June 19th 08 10:31 PM
Help - Loop Function Giving Incorrect Output Jenny Marlow Excel Programming 4 April 25th 08 07:40 PM
Need Help With My Loop That Creates Output File Jenny Marlow Excel Programming 5 April 24th 08 11:42 PM
Need Help With Loop That Creates Output File Jenny Marlow Excel Discussion (Misc queries) 0 April 23rd 08 11:23 PM
Using a Loop Statement to Pass Data between WKS and Output File Belzeddar Excel Programming 2 January 14th 04 07:40 AM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"