+ Reply to Thread
Results 1 to 7 of 7

Autofill columns with formula when inserting new rows

  1. #1
    Registered User
    Join Date
    09-19-2019
    Location
    UK
    MS-Off Ver
    2019
    Posts
    4

    Post Autofill columns with formula when inserting new rows

    I have a spreadsheet with a table that has these headings:

    Project -- Project Owner -- Days Until Deadline -- Project Support

    In project owner, days until deadline and project support there are formulas so that the table reads from a Master sheet and pulls the information through, so that it will automatically change when changed on the Master.

    I am trying to have it so that when someone inserts a new row to enter a new project, these formulas automatically appear in the new row.

    Is there a way I can do this??


    (I have had to post this on multiple sites as I literally couldn't get an answer anywhere. I would post the links but this forum won't let me as I have not posted multiple times?)
    Last edited by browne09; 09-19-2019 at 08:51 AM.

  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: Autofill columns with formula when inserting new rows

    Use a table.

    Select your data, then Insert > Tables > Table.
    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
    Registered User
    Join Date
    09-19-2019
    Location
    UK
    MS-Off Ver
    2019
    Posts
    4

    Re: Autofill columns with formula when inserting new rows

    It is already in a table. When inserting a new row, at the moment, only the formula within the project owner column is copied down automatically. The other two are not. I'm not sure why this is.

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

    Re: Autofill columns with formula when inserting new rows

    Copy and paste your formula to all cells in the column. This should 'reset' the calculated column formula.

  5. #5
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: Autofill columns with formula when inserting new rows

    You could always try the below, just change the 2 for the column with the primary field and the B for the column the formula is in

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-19-2019
    Location
    UK
    MS-Off Ver
    2019
    Posts
    4

    Re: Autofill columns with formula when inserting new rows

    Ok so I have used the code:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Cancel = True
    Target.Offset(1).EntireRow.Insert
    Target.EntireRow.Copy Target.Offset(1).EntireRow
    On Error Resume Next
    Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
    End Sub


    This works exactly how I want it to, but is there a way I can apply it to only a specific set of columns? There are certain columns that if double clicked will disrupt the formatting of the table.

  7. #7
    Registered User
    Join Date
    09-19-2019
    Location
    UK
    MS-Off Ver
    2019
    Posts
    4

    Wink Re: Autofill columns with formula when inserting new rows

    *Solved*

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

    Cancel = True

    If Target.Column > 6 Then
    Target.Offset(1).EntireRow.Insert
    Target.EntireRow.Copy Target.Offset(1).EntireRow
    On Error Resume Next
    Target.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
    End If

    End Sub

+ 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. Replies: 1
    Last Post: 05-30-2015, 03:12 PM
  2. Autofill columns with rows?
    By Miltos01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-25-2013, 04:31 PM
  3. Formula autofill to columns, NOT rows?
    By gaastra in forum Excel General
    Replies: 11
    Last Post: 08-13-2010, 11:35 AM
  4. Autofill columns and rows simultaneously
    By MCCCLXXXV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2008, 05:45 PM
  5. Static formula when inserting new rows/columns?
    By nfe in forum Excel General
    Replies: 4
    Last Post: 05-02-2006, 10:00 AM
  6. [SOLVED] Autofill dynamic no. of rows and columns
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2005, 09:05 PM
  7. Autofill Macro for 2 rows and 100 columns
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2005, 08:05 AM

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