Hi,
I hope someone can help me out on a project I am undertaking at work that has not only got me but most of the other guys in the office stumped to the degree that we are not sure that it is possible!
To outline the problem; we have a list of individual locations which have a three or four digit ‘route’ code and a specific mileage. We need to apply to these (in a separate column) an additional number code (‘cat’) from a different list. This ‘cat’ code is based on the ‘route’ and a mileage ‘band’. I have managed to write the macro code to undertake this part of the project and it appears to work ok, however there is another more complex step in that some of the look up list codes are repeated with different mileage bands and have a different ‘cat’ number. What we need is for a macro (or formula) to go through the list and insert the lowest value available for the ‘cat’ code and mileage. The sample below should explain slightly better what we are trying to do.
Does anyone know if this is possible?
Route Mileage
ABC 123.4567
DEF 89.1011
Route Start Mile End Mile Cat
ABC 120.0099 125.1011 2
ABC 118.1000 125.1011 1
ABC 125.1011 129.0000 3
DEF 85.0000 95.0000 4
DEF 87.1500 90.1000 3
So the result would be
Route Mileage Cat
ABC 123.4567 1
DEF 89.1011 3
Code so far is as follows
Many thanks
Bookmarks