+ Reply to Thread
Results 1 to 6 of 6

Insert rows based on an entered cell value

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    Lincoln, UK
    MS-Off Ver
    2010
    Posts
    19

    Insert rows based on an entered cell value

    I need to add some coding to allow inserting of rows based on a cell value - but to insert one row down from that cell to allow the formatting to be copied from the second row - here is a snapshot of what I need below: The user would be entering a number into C3 for example, I then want it to insert that number of rows between row 4 and 5? (the range "Invoices" refers to all dark blue cells in column C where the number would be entered)

    thanks


    Excel Sheet_1.JPG

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Insert rows based on an entered cell value

    Something like:
    Please Login or Register  to view this content.
    Note this code should be entered in the worksheet module, not a general module.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Insert rows based on an entered cell value

    This may be a case where "a picture is worth a thousand words" but the best way to get help is to upload the file after removing all sensitive data.

    Alf

    Ps to add to Olly's solution. If your data is in a table you may need to set table to range, run macro and then convert range to table.
    Last edited by Alf; 11-28-2014 at 07:19 AM.

  4. #4
    Registered User
    Join Date
    11-25-2014
    Location
    Lincoln, UK
    MS-Off Ver
    2010
    Posts
    19

    Re: Insert rows based on an entered cell value

    Thats brilliant, works perfectly. Thanks very much Olly - this has completed my log finally!

  5. #5
    Registered User
    Join Date
    11-25-2014
    Location
    Lincoln, UK
    MS-Off Ver
    2010
    Posts
    19

    Re: Insert rows based on an entered cell value

    Sorry just an extra point - can I get the formula in column H (its just a calc for the gross value =F4+(F4*G4) ) to copy into the inserted row/s?

    the inserting row works perfectly, just need this formula to be automatic as the column is locked down not user driven.

    many thanks in advance

  6. #6
    Registered User
    Join Date
    11-25-2014
    Location
    Lincoln, UK
    MS-Off Ver
    2010
    Posts
    19

    Re: Insert rows based on an entered cell value

    Hi,

    can I get the formula in column H (its just a calc for the gross value =F4+(F4*G4) ) to copy into the inserted row/s?

    many thanks

+ 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] 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
  2. [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
  3. 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
  4. [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
  5. 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