Hello,
I am trying to develop a small dataset using excel macro. The logic is fairly simple. However, it has to be repeated for about 4000 different records (each record is a row in excel) and thus I am trying to use a macro to build this. I am totally new to macros and am having difficulty figuring it out. I am providing the details as to what I want below.
The first sheet with the name SHORT_TIME_ROUTES has 5 columns. First two columns are the record names (each record corresponds to a route). Third column shows the time to travel that route and the fourth column shows the total length of the route.
What I want to do is, create multiple records for the same route with length intervals. For example, if a particular route has a total length of 150 m, then I would like to have 30 new records for this route with an interval of 5 m. I have shown the output I need in Sheet1. As can be seen, i calculated the total number of intervals by dividing the length with the interval length (5m). For every record, the starting point will be 0 m. Then it keeps on incrementing at 5 m unless the length of the route terminates before the next 5 m interval.
I have recorded a macro to do this. But, having no experience with this, it is not yielding me the results i want. Can anyone help me with this. The code is pasted below and the excel sheet is attached.
Please Login or Register to view this content.
Bookmarks