Results 1 to 10 of 10

script to go through a list and select the lowest price at specific locations

Threaded View

  1. #1
    Registered User
    Join Date
    11-07-2013
    Location
    Sverige
    MS-Off Ver
    Excel 2013
    Posts
    6

    script to go through a list and select the lowest price at specific locations

    Hello all!

    I have very limited experience with programming. But i need to write a function for my spreadsheet. Let me try to explain.

    In the spreadsheet there are several lists. Each list contain the price and location of one commodity. In column A there is a description of the location, and in column B the price is listed. Each list is sorted by price (low to high). For some commodities there are up to 50 locations and for some only a few. Since it's sorted by price, the same location can appear randomly through out the list if there are more then one supplier on that specific location.

    Here's what i need to do. I'm only interested in 5 specific locations, and i'm only interested in the lowest price of each location. Since there is over 50 lists, and they are updated frequently, i can't go through all information manually. Let's call the locations "L1 - L2 - L3 - L4 - L5".

    First of all, i have all the lists on one sheet and i want the function to go through the lists and get the lowest prices from each location, for each commodity, and put them on a separate sheet where i have it organised so i can get a good overview of the information.

    So here is what i'm thinking in (what i think is) pseudo code.

    ___________________________________________________________________________________________

    Start from the top of the Column A (location) of the first list

    * Start loop

    * * If (the cell contains the name of L1)

    * * * Copy the price from the same line but column B (price) and paste it on a specified cell in the overview sheet.

    * * * End loop


    * * else if (the cell does not contain the name of L1)

    * * * Step down one cell and repeat


    * * else if (The cell contain no text) ;;;there was no match

    * * * Stop searching for L1

    * * * End loop


    * Start loop

    * * If (the cell contains the name of L2)

    * * * Copy the price from the same line but column B (price) and paste it on a specified cell in the overview sheet.

    * * * End loop


    * * else if (the cell does not contain the name of L2)

    * * * Step down one cell and repeat


    * * else if (The cell contain no text) ;;;there was no match

    * * * End loop
    _____________________________________________________________________________


    And so on for each of the 5 locations. I'm guessing it's not optimal - but it seems to be the most intuitive approach for someone with limited experience like me. When it's finished with one list i want it to move on to the next. But maybe if i can get going with this i will be able to figure that out by my self!!

    Any help would be greatly appreciated!


    Best Regards,
    milmil
    Last edited by milmil; 11-07-2013 at 03:16 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Lowest price & Lowest lead time
    By thup_98 in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 01-22-2013, 03:21 PM
  2. [SOLVED] Lookup lowest value in a list for an item for a specific date
    By JungleJme in forum Excel General
    Replies: 5
    Last Post: 07-26-2012, 05:28 AM
  3. Excel 2007 : Help finding lowest price in list of orders
    By Snoozeburger in forum Excel General
    Replies: 6
    Last Post: 10-14-2010, 03:05 AM
  4. script for writing excel values into specific locations in a text
    By whiz999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2009, 11:35 AM
  5. Mark the Lowest price in a price-matrix
    By raed_237 in forum Excel General
    Replies: 8
    Last Post: 04-07-2009, 01:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1