+ Reply to Thread
Results 1 to 3 of 3

Using Autofill to repeat formula in column in relation to data in other columns

  1. #1
    Registered User
    Join Date
    12-02-2016
    Location
    Stockholm
    MS-Off Ver
    2010
    Posts
    2

    Post Using Autofill to repeat formula in column in relation to data in other columns

    Hi all,

    I'm new to both VBA and the forum. I've come across a problem that I can't seem to find a solution to and I'm hoping you can help me out.

    My worksheet consists of 4 columns of data. A "Action", B "Start Date", C "End Date" and D "Duration".
    In column D I want to calculate the duration in days between the two dates. Which is very easy in the sheet itself. Now I recorded a macro which calculates the duration and that also autofills the values in the rows below the first calculation.

    The below code is what the Excel recorded. Now this works just fine if I stick with data in that range, however if new rows are added to the columns A-C the calculation would then still only be run until cell D5 when the macro is run once more. How would I go about solving this, making it "dynamic" in relation to the data columns to the left of column D?

    Please Login or Register  to view this content.
    I would very much appreciate your input! Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,033

    Re: Using Autofill to repeat formula in column in relation to data in other columns

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    12-02-2016
    Location
    Stockholm
    MS-Off Ver
    2010
    Posts
    2

    Re: Using Autofill to repeat formula in column in relation to data in other columns

    Thank you very much. This works perfectly.

+ 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] Row data to column, with two columns of data to repeat
    By TanyaMc in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 06-06-2016, 01:19 PM
  2. Repeat formula in column H until the last row with data in column G
    By matteobsuetti in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2015, 08:36 AM
  3. Autofill data in adjoining columns based on value selected in first column
    By ishwarananda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2014, 06:03 AM
  4. [SOLVED] Repeat Column of Data Down a Row Using a Formula
    By pookyman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-10-2014, 11:56 AM
  5. Worksheet function to Autofill formula in column A when data entered in column B
    By boylers75 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 02:27 PM
  6. Autofill Columns with data from another column
    By Mackb in forum Excel General
    Replies: 4
    Last Post: 12-20-2010, 06:26 PM
  7. Autofill:a column to repeat vendor names
    By Confused? in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2005, 07:06 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