+ Reply to Thread
Results 1 to 10 of 10

How to insert a new row and keep the formula? (Without using Tables!)

  1. #1
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Post How to insert a new row and keep the formula? (Without using Tables!)

    I have been searching for a way to insert a new row with formula but could not find a solution. I don't want to use tables as it will completely mess up my formula. Please check the example workbook attached.
    Last edited by ramilh; 12-05-2022 at 08:16 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,231

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    What do you mean? If you convert that to a Table, the refernces REMAIN as B2/C2 and the formula automatically appears in any inserted row.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36
    Quote Originally Posted by Glenn Kennedy View Post
    What do you mean? If you convert that to a Table, the refernces REMAIN as B2/C2 and the formula automatically appears in any inserted row.
    I want the inserted rows to include formulae without using a table. I cannot use a table on my main workbook because it messes up thousands of rows of data

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,231

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    Show me how it messes it up.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,454

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    Try something like
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    Quote Originally Posted by Pepe Le Mokko View Post
    Try something like
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It doesn't work. It still adds blank rows without formula.

  7. #7
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    Quote Originally Posted by Glenn Kennedy View Post
    Show me how it messes it up.
    I have insert row code as below (for a different purpose). When I insert table not only it messes up my whole formula system, it also doubles the size of the file (which is 15 mb as of now). It also doesnt let my below code to run.

    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim lr&, Durum As Range, r&
    If Target.Count = 1 Then
    lr = Cells(Rows.Count, "B").End(xlUp).Row
    If Not Intersect(Target, Range("X4:X" & lr)) Is Nothing And LCase(Target) = "tamamlandı" Then
    Set Durum = Range("X4:X" & lr).Find(what:="Tamamlandı", after:=Target, lookat:=xlWhole, MatchCase:=False)
    If Not Durum Is Nothing Then
    r = Durum.Row
    If r <> Target.Row Then
    Range("A" & Target.Row & ":x" & Target.Row).Cut
    Range("A" & r & ":x" & r).Insert shift:=xlDown
    Range("X" & r).Activate
    End If
    End If
    End If
    End If
    End Sub

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,231

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    Still no sample sheet showing the problem.

  9. #9
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    Quote Originally Posted by Glenn Kennedy View Post
    Still no sample sheet showing the problem.
    I have uploaded the sample sheet. Please kindly check.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,231

    Re: How to insert a new row and keep the formula? (Without using Tables!)

    1. Move your shift times to an area ABOVE the data.

    2. Demerge the headers aand move them to ONE row above the data body.

    3. Increase the width of the header row.

    4. Convert to Table.

    5. Insert row (see purple cells).

    6. Anything messed up? You may need to adjust the VBA a bit. I have no idea, as I do not use it. But the changes I made were ALL outside the data body.
    Attached Files Attached Files

+ 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] can't insert row in two tables
    By freeriding in forum Excel General
    Replies: 5
    Last Post: 02-22-2019, 07:23 AM
  2. Insert> Pivot Table versus Insert> Recommended Pivot Tables
    By leaning in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-14-2018, 02:07 AM
  3. vba macro to insert into oracle tables
    By Khaled Diab in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-26-2014, 03:19 AM
  4. [SOLVED] Insert a row in 2 tables with VBA code
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 09:00 AM
  5. Insert rows in several tables : how to speed up ?
    By Adrian692 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2013, 02:10 PM
  6. How to insert tables?
    By all4excel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-26-2007, 06:32 AM
  7. Tables tab under the Insert tab
    By Chuck Divine in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-29-2005, 07:35 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