+ Reply to Thread
Results 1 to 3 of 3

Macro to insert line or remove line depending on cell in column A.

  1. #1
    Registered User
    Join Date
    11-17-2015
    Location
    Trenton, Ohio
    MS-Off Ver
    2016
    Posts
    3

    Macro to insert line or remove line depending on cell in column A.

    I have a very long list that I need to organize. This is what the format looks like:

    H1001
    H1001-1
    H1001-2
    H1029
    H1029-1

    However, not every number with a -# has a line preceding it with the main H number. In this case I need to insert a line above the first instance of every H####-# as shown below.

    H3914
    H3914-1
    H3917
    H3917-1
    H3923-1
    H3926-1
    H3935-1

    And in other cases a main H number is shown but no -# lines follow so I will need to remove those lines.

    I am at 4000 lines and would like to speed up this process. Any help would be greatly appreciated.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to insert line or remove line depending on cell in column A.

    Why is there no Main Number above H3923-1, H3926-1 and H3935-1?

    I think you may need to upload the workbook with some specific examples of a before and after list for both cases you identify.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-17-2015
    Location
    Trenton, Ohio
    MS-Off Ver
    2016
    Posts
    3
    Quote Originally Posted by Richard Buttrey View Post
    Why is there no Main Number above H3923-1, H3926-1 and H3935-1?

    I think you may need to upload the workbook with some specific examples of a before and after list for both cases you identify.
    not every number with a -# has a line preceding it with the main H number. In this case I need to insert a line above the first instance of every H####-# as shown below.

    H3914
    H3914-1
    H3917
    H3917-1
    H3923-1
    H3926-1
    H3935-1

+ 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. Insert line based on cell not line number
    By MattMax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2017, 10:05 AM
  2. Insert line based on cell not line number
    By MattMax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2017, 10:04 AM
  3. Insert line according to cell value not line number
    By MattMax in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 10-26-2017, 10:15 PM
  4. [SOLVED] Macro Assistance - inserting cell & data line by line not by column
    By Toxicca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2015, 09:26 AM
  5. [SOLVED] MultiLine Textbox to auto remove blank line, count line, remove duplicate
    By khhoa in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-24-2015, 09:28 PM
  6. Replies: 3
    Last Post: 03-20-2006, 12:10 PM
  7. How to insert line on other worksheet depending upon result in cell?
    By Pheasant Plucker® in forum Excel General
    Replies: 4
    Last Post: 03-17-2006, 05:10 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