+ Reply to Thread
Results 1 to 13 of 13

Insert 2 rows between specific numbers in Col A

  1. #1
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Insert 2 rows between specific numbers in Col A

    I have tried to write code to insert 2 rows in Col A at the start of the each number in the column beginning with 153, 163, 173 & 193.


    In the attached sample data, the raw data is in sheet1 and the result onn sheet "Manual result" to show you what the final outcome should look like

    The following code is highlighted in red

    Please Login or Register  to view this content.



    See my full code below

    Please Login or Register  to view this content.


    Your assistance in this regard is most appreciated

    I have also posted on the link below yesterday


    https://www.mrexcel.com/forum/excel-...in-number.html
    Attached Files Attached Files
    Last edited by flupsie; 07-04-2018 at 10:20 PM.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Insert 2 rows between specific numbers in Col A

    What happens if the number does not begin with one of those 4 options?

    BSB

  3. #3
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Insert 2 rows between specific numbers in Col A

    If it does not begin with the 4 options, then it must be ignored i.e no rows to be inserted for any other numbers. There is a small likelihood of this happening though

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Insert 2 rows between specific numbers in Col A

    Same result as in your attachment.
    Please Login or Register  to view this content.

  5. #5
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Insert 2 rows between specific numbers in Col A

    Thanks for the help, much appreciated

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Insert 2 rows between specific numbers in Col A

    You're welcome.
    Good Luck

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Insert 2 rows between specific numbers in Col A

    More in line with the "Always delete rows from the bottom up"
    Please Login or Register  to view this content.

  8. #8
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Insert 2 rows between specific numbers in Col A

    thanks for the updated code

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Insert 2 rows between specific numbers in Col A

    It still doesn't take care of entries that do not fit the 4 options.

    Try this slightly amended version of jolivanes' code:
    Please Login or Register  to view this content.
    BSB

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Insert 2 rows between specific numbers in Col A

    Please Login or Register  to view this content.

  11. #11
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Insert 2 rows between specific numbers in Col A

    Thanks for your help, Guys

  12. #12
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Insert 2 rows between specific numbers in Col A

    Hi

    and here VBA novice solution

    Please Login or Register  to view this content.
    Appreciate the help? CLICK *

  13. #13
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Insert 2 rows between specific numbers in Col A

    Thanks for your code AZ-XL

+ 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 multiple rows each specific number of rows
    By salmasaied in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-24-2016, 09:58 AM
  2. [SOLVED] Insert multiple rows each specific number of rows
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 05-21-2016, 10:36 AM
  3. [SOLVED] Macro to insert specific number of rows, populate rows with data above except date
    By Melissa Camp in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-08-2015, 03:59 PM
  4. [SOLVED] Insert row numbers into column A, reflect correct row numbers when I add or delete rows
    By jcambell in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2015, 02:18 PM
  5. Insert 0 into specific column and specific rows
    By csincava in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2015, 04:49 PM
  6. [SOLVED] Insert Rows on Criteria and Copy content to Specific Cells in New Rows(Tables)
    By TheScott in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-01-2015, 03:38 PM
  7. Insert/Delete rows based on the same numbers of rows with data in other sheet
    By Blokeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2015, 08:28 PM

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