+ Reply to Thread
Results 1 to 2 of 2

Creating dataset with Excel Macro

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Creating dataset with Excel Macro

    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.
    Attached Files Attached Files

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Creating dataset with Excel Macro

    Have you found a solution?

    I got this working, but there are too many rows for single sheet.

    How can it be split?

    You could put a combobox on the route sheet, and only select the route you need to work on.
    David
    (*) Reputation points appreciated.

+ Reply to Thread

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