+ Reply to Thread
Results 1 to 12 of 12

Insert rows based on a value in another cell

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Insert rows based on a value in another cell

    Hi Experts,

    I have looked into the Forum for prior posts but I seem to be missing how to do what I am trying to do. I need to copy values from Sheet1 and Paste to Tab Formatted, with a blank line inserted after a given number of lines. The value of lines needed before the insert is listed on tab Formatted in cell F1. I can add all of the other formulas that I am using to fill in the rest of the values but I am stuck on getting the lines inserted to the Formatted tab. Please feel free to point me to a prior thread, but I have looked. Also, please feel free to ask for more info, I have attached the file I am working on.

    Thanks again

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Insert rows based on a value in another cell

    So your just wanting from your example.... F6 has the number 6. You wanting to copy 6 rows skip 1 row and copy the next 6 rows skip a line ect......
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Insert rows based on a value in another cell

    Hi Mike,

    I am looking for it to count down six rows and insert a blank row and then count down the next six and insert a blank row. So after every six lines of data there is a blank. I also realized I need to put a formula on three columns on the inserted rows, but I can look into that on the forum. See below to see if that helps. Thank you very much

    1
    2
    3
    4
    5
    6

    7
    8
    9
    10
    11
    12

    13
    14
    and so on

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Insert rows based on a value in another cell

    Confused because you said in your first post, you want to copy and paste your data from sheet1 to the formatted sheet? Is that correct?

  5. #5
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Insert rows based on a value in another cell

    Sorry for the confusion. I want to copy from Sheet1 to Formatted, I have the macro for this. I then want to insert a blank row based on the number entered into F6 on the Formatted tab. This is where I am having trouble getting my macro to insert the line after each record based on F6 value. I think I have the rest of the macro(s) working but just need help on the Inserting a blank row piece. Once again, sorry for the confusion. I was talking about the whole thing but only needed help with the insertion piece.

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Insert rows based on a value in another cell

    This will do the copying over to the Formatted sheet while adding in the blank row. If I knew where and what formulas you are wanting, I could add them into the code as well.

    Please Login or Register  to view this content.
    Last edited by mike7952; 09-10-2016 at 07:21 AM.

  7. #7
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Insert rows based on a value in another cell

    Hi Mike,

    First, thank you very much the code works perfectly. Since what you put together works much better than what I am trying to do I thought I would attach the file I am trying to format and see if you have a way to make it work. I have highlighted everything in yellow that needs to be setup. I put all of the formulas on the lines that you have being inserted. I also realized that the first line has a drop in the line item values (see Clolumn O and P) so I think I need to shift the cells in P to AA down one after the inserted row. Please let me know if this is too much to ask of you or if you are able to help please let me know what more info you need. I cannot begin to thank you enough for the code you have already sent.

    Thanks

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Insert rows based on a value in another cell

    Give this workbook a try. Results are going to sheet2

  9. #9
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Insert rows based on a value in another cell


  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Insert rows based on a value in another cell

    Think this will do it if I understand what you are wanting to do, if not should be pretty close

  11. #11
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Insert rows based on a value in another cell

    Try this workbook and see if we got everything right now.

  12. #12
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Insert rows based on a value in another cell

    Perfect. Thank you again. I will leave you alone 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. Insert rows based on value in cell.
    By JPEckelman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2014, 07:16 AM
  2. [SOLVED] Insert rows based on the current cell value and, then, copy some cells into the new rows
    By Excel-RZ in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-03-2013, 05:19 PM
  3. [SOLVED] insert rows based on number in cell and copy the data down into the new rows
    By pziefle in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-05-2013, 11:19 AM
  4. Insert rows based on a value in a cell and copy the data down into the new rows
    By eyeman96 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2013, 07:54 AM
  5. [SOLVED] Insert Multiple Rows Based Off Number in Cell and Copy Data From Above New Rows
    By tstell1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 04:15 PM
  6. Insert and name rows based on cell value
    By retroboy17 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-28-2010, 10:17 AM
  7. Delete Rows based on cell value and then Insert rows alternatively with a formula
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-11-2008, 04:27 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