Results 1 to 11 of 11

Insert missing rows into repeating number sequence

Threaded View

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Insert missing rows into repeating number sequence

    Hi guys,
    I may be asking too much, but I'm hoping someone with far better vBA skills than me can help me out!
    I have a spreadsheet where one column (F) contains a repeating number sequence of 0-23. I need a macro that will insert a row where this sequence is broken and fill in the number in column F. Seems simple so far, however there may be multiple numbers missing in sequence i.e. 1,2,5 where I need 3 and 4 inserted.

    To make things more interesting the pattern always restarts at 0 which could come at any point in the pattern, the only time that I need rows inserted if 0 breaks the pattern is if a 0 follows 21 or 22.
    So for example 1,2,3,4,5,6,7,8,9,10,0,1,2,3,4,5 would be fine but 18,19,20,21,22,0,1,2,3 would need to become
    18,19,20,21,22,23,0,1,2,3.

    I have attached a worksheet with raw data and the expected outcome.


    Cheers guys, any help will be greatly appreciated.
    Budgie300

    Test1.xls
    Last edited by budgie300; 09-10-2012 at 04:30 PM.

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