Results 1 to 20 of 20

Code loop through two tables checking and altering

Threaded View

  1. #1
    Registered User
    Join Date
    08-30-2008
    Location
    London
    Posts
    35

    Code loop through two tables checking and altering

    Hi I have a looping code problem I was wondering if you could have a quick look for me.

    I have two tables of information. The first is a matrix with some distances. The second is a table of distribution. Ive been trying this for a long time now with limited success using a truth table but i've realised the only way to do this is in code. Ive got limited experience with this so please point me in the right direction.

    Ive written some steps explaining what each table does here -

    Step 1 Check for lowest value B4:F4 in Table 1 (in example is 10)
    Step 2 Check corresponding column destination available capacity in table 2 (Example 500)
    Step 3 Distribute as much as possible from source in table 2 (500)
    Step 4 Reduce value in capacity line by value taken from source
    Step 5 If some source remains move back to table 1 and find next nearest column Dest
    Step 6 Repeat step 2 until all source is gone in row
    Step 7 Check for lowest value B5:F5 in Table 1
    if run out of capacity at all sites stop code
    etc
    until Table 1 column B is empty

    Ive posted a spreadsheet with some before and after tables in it aswell. Its very small and formatted o its easy to see whats happening.

    Thanks for taking a look.
    Last edited by VBA Noob; 11-12-2008 at 05:57 PM. Reason: Marked as solved

Thread Information

Users Browsing this Thread

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

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