+ Reply to Thread
Results 1 to 4 of 4

Only Copy Formula from the Row Above

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Only Copy Formula from the Row Above

    I am using the following code to insert and delete rows on a protected worksheet when there are locked columns. I want to be able to copy down any formulas from the row above when inserting new rows, but literally only formula not the content of the entire row. On the attached sample when inserting one or multiple rows, I would want to insert blank rows whilst copying the formula in columns N and AA down so the user can make new entries and the rows still sum. Is this possible? This would relate to any and all formula.

    Using
    Please Login or Register  to view this content.
    copies the entire row.

    This code on ThisWorkbook

    Please Login or Register  to view this content.
    And this code in a module

    Please Login or Register  to view this content.
    Many thanks
    Attached Files Attached Files
    Last edited by HangMan; 05-24-2015 at 05:43 AM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Only Copy Formula from the Row Above

    Hi Hangman

    Add the two lines of Code to the InsertRows procedure...

    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Only Copy Formula from the Row Above

    Thanks jaslake, that works perfectly... so it's a case of having to 'manually' specify every column that contains the formula to be copied down as per your two additional lines?

    Many thanks

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Only Copy Formula from the Row Above

    Hi Hangman

    There are probably other ways...this is clean and simple...
    specify every column that contains the formula to be copied down
    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Alter existing formula to copy specific cells in row instead of copy entire column
    By painterartist in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-02-2014, 12:42 PM
  2. Replies: 8
    Last Post: 07-08-2013, 06:03 AM
  3. Replies: 3
    Last Post: 01-30-2013, 04:32 PM
  4. Copy Formula:copy the exact same formula in one column
    By Leprechaun in forum Excel General
    Replies: 1
    Last Post: 12-11-2006, 07:46 PM
  5. [SOLVED] Copy/Paste how to avoid the copy of formula cells w/o calc values
    By Dennis in forum Excel General
    Replies: 10
    Last Post: 03-02-2006, 06:50 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