+ Reply to Thread
Results 1 to 3 of 3

Insert lines between rows based on numbered string headers.

  1. #1
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Insert lines between rows based on numbered string headers.

    Can somone help me figure out how to use a macro to loop through data in column 'B' and do the following:

    - Data in column B will be all strings. The strings mostly start with a number such as 1.0, 1.1, 2.0, 2.1...
    - Insert blank cells between the lines with the first digit of the number. (1.0, 1.1, 1.2, <space>, 2.0, 2.1, <space>, 3.0, 3.1, 3.2, <space>, 4.0, <space>, 5.0 etc...)
    - Some of the cells contain what I call 'runover text'. These will have no number at the beginning such as to signify that the text is a continuation of the cell above.
    - I would like to maintain the (by 10) numbering in column 'A'

    Original:

    spaces_old.xls

    becomes:

    spaces_new.xls

    Thank you for your time. Any help appreciated

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Insert lines between rows based on numbered string headers.

    Try this:-
    Results in columns "C : D" based on "A : B"

    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Re: Insert lines between rows based on numbered string headers.

    Thank you.

    After testing it wouldn't work on my actual data (subscript out of range), but it worked on the test sheet perfectly. After a bit of trial and error, I figured out that the problem is that my original data already has a few blank cells in in column b. If I eliminate the pre-existing blank cells, then it works just fine. I probably need something like 'if not c is nothing in there somewhere? aka 'nothing to see here. move along now...'

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I insert two rows between lines of data
    By Tanya S. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2013, 05:41 PM
  2. [SOLVED] Macro to insert lines based on cell content
    By MirTraynor in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-08-2012, 11:06 AM
  3. [SOLVED] unwanted numbered lines
    By GEGO in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-14-2012, 08:11 AM
  4. How to insert lines and dates based on criteria
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2011, 02:06 PM
  5. Column headers being numbered, not lettered?
    By robbert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2009, 10:32 AM

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