Results 1 to 7 of 7

Thread: Copy formula when inserting row in specific columns
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Nov 2016
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Copy formula when inserting row in specific columns

    Hi all,

    On a specific sheet (for example "sheet ABC") in a specific workbook (for example "Workbook ABC"), I have formulas in the columns D, E, G, J and I.

    Is there a possibility, when inserting row(s), to automatically copy the formulas down in the inserted rows in the specific columns?

    Thanks!

  2. #2
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,400
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: Copy formula when inserting row in specific columns

    Are you inserting the rows manually or with vba?
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  3. #3
    Board Regular
    Join Date
    Nov 2016
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy formula when inserting row in specific columns

    Quote Originally Posted by Peter_SSs View Post
    Are you inserting the rows manually or with vba?
    Manually.

  4. #4
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,400
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: Copy formula when inserting row in specific columns

    Quote Originally Posted by TimvMechelen View Post
    Manually.
    Then I don't think you can get your formulas in question automatically copied down.
    However, you could have a macro that both inserts a row (or multiple rows) and copies the relevant formulas down. Is that something you would be interested in?
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  5. #5
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,400
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: Copy formula when inserting row in specific columns

    Quote Originally Posted by Peter_SSs View Post
    Is that something you would be interested in?
    In case you are, you could try this in a copy of your workbook.
    Select a row or rows or even a cell or cells in a contiguous area where you want the new rows inserted (e.g. you could select B10:D11 if you wanted 2 rows inserted below row 9) & then run the following macro.

    Code:
    Sub Insert_Rows()
      With Selection
        If .Areas.Count = 1 Then
          .EntireRow.Insert
          Intersect(.EntireRow.Offset(-.Rows.Count - 1).Resize(.Rows.Count + 1), Range("D:E,G:G,I:J")).FillDown
        End If
      End With
    End Sub
    Last edited by Peter_SSs; Aug 13th, 2019 at 10:57 AM.
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  6. #6
    Board Regular
    Join Date
    Nov 2016
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy formula when inserting row in specific columns

    Quote Originally Posted by Peter_SSs View Post
    In case you are, you could try this in a copy of your workbook.
    Select a row or rows or even a cell or cells in a contiguous area where you want the new rows inserted (e.g. you could select B10:D11 if you wanted 2 rows inserted below row 9) & then run the following macro.

    Code:
    Sub Insert_Rows()
      With Selection
        If .Areas.Count = 1 Then
          .EntireRow.Insert
          Intersect(.EntireRow.Offset(-.Rows.Count - 1).Resize(.Rows.Count + 1), Range("D:E,G:G,I:J")).FillDown
        End If
      End With
    End Sub
    Thanks! it works

  7. #7
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    41,400
    Post Thanks / Like
    Mentioned
    100 Post(s)
    Tagged
    21 Thread(s)

    Default Re: Copy formula when inserting row in specific columns

    Quote Originally Posted by TimvMechelen View Post
    Thanks! it works
    You're welcome. Thanks for the follow-up.
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •