+ Reply to Thread
Results 1 to 5 of 5

Complicated Insert Row Function

  1. #1
    Registered User
    Join Date
    02-15-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Complicated Insert Row Function

    Ok, not sure if this is possible, but here is what I am trying to do and I imagine doing it (if you have a simpler solution, please feel free to suggest it)

    I have a data set which consists of time codes that are various distances apart from each other. I need to fill in the gaps between them by every second.

    What it looks like now (two line example):

    16:03:22
    16:03:29

    What I want it to look like:

    16:03:22
    16:03:23
    16:03:24
    16:03:25
    16:03:26
    16:03:27
    16:03:28
    16:03:29

    The data set is too large for manually inserting the rows to be practical, but I have a row that displays how many seconds difference there is between two adjacent entries (so for the example it says 7 seconds obviously), so I know how many rows need to be inserted. Is there a way to automatically insert a set of rows between each entry that references the count column so that it inserts the correct number of rows?

    Thanks for your help!
    Last edited by cdenney; 02-15-2012 at 06:37 PM.

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Complicated Insert Row Function

    Assuming
    - the times in column A
    - the amount of missing values in column B

    Please Login or Register  to view this content.
    It would help if you post a sample workbook see the forum rules).

    If the rows are still empty it's easier to use autofill in Column A.
    Last edited by snb; 02-15-2012 at 04:33 PM.



  3. #3
    Registered User
    Join Date
    02-15-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Complicated Insert Row Function

    Thanks for your reply, I had not seen the forum rules tab beforehand, so thanks for directing me there.

    I inserted the code and tried to run it but got a run-time error 438 saying "Object does not support this property or method". I am not sure if this is because your code was general and needs to be specified for my worksheet or if I am missing a plug-in to excel or what the issue is. I would guess it is the first option, but I'm not sure which portions to change to make them work for my workbook.

    Thanks again for your help.
    Attached Files Attached Files

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Complicated Insert Row Function

    we won't need column B

    if the first time value is in cel A1:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-15-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Complicated Insert Row Function

    That worked perfectly, thanks for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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