+ Reply to Thread
Results 1 to 4 of 4

Copying Formula When Adding Rows With Macro

  1. #1
    Registered User
    Join Date
    11-04-2014
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    14

    Copying Formula When Adding Rows With Macro

    I have a macro that add rows to a range. The new rows copy the formula from the row above correctly except for the first column. Any suggestions?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Copying Formula When Adding Rows With Macro

    Quote Originally Posted by angusfire View Post
    ... Range("Date_List").Cells(0, 1).Row - 1 ...
    What if cell "Cells(0, 1)" of the "Date_List" range is in row #1 ? Then 'Row - 1' = 0, but there is no row #0.
    Give us an example of the data layout.

  3. #3
    Registered User
    Join Date
    11-04-2014
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    14

    Re: Copying Formula When Adding Rows With Macro

    Attached is an example from my question. The table has a default number of rows (18) that will be the minimum. Additional rows will be added when the user entered date exceeds the last date in the table. The new rows would be added above the last row so that the previous formulas are copied down. The last row of the table has a different formula than do the rows above it. The way I currently have the code it copies the formulas correctly for each column of the table except for the first column. Once the code works correctly, I will be tying it to a worksheet change each time a new date is entered.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-15-2015
    Location
    nederland,Heerlen
    MS-Off Ver
    2013
    Posts
    18

    Re: Formule kopiëren bij het toevoegen van rijen met macro

    Look Here its working
    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] VBA - Copying columns, adding rows
    By MoldyBread in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2014, 11:19 PM
  2. [SOLVED] Macro required for copying above rows with formula, formatting, serial no.
    By mpsingh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2014, 02:18 PM
  3. [SOLVED] Copying Rows and Adding to an Integer
    By abba92 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 04:12 PM
  4. Replies: 0
    Last Post: 04-27-2012, 04:22 PM
  5. Copying colums of formula and adding blank rows
    By tallgingerbloke in forum Excel General
    Replies: 8
    Last Post: 07-02-2011, 01:59 PM
  6. adding and copying rows
    By CatherineN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2006, 05:07 PM
  7. [SOLVED] Copying and skipping (adding) rows
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2006, 02:40 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