+ Reply to Thread
Results 1 to 5 of 5

Macro to insert formula and copy down column

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    Posts
    465

    Unhappy Macro to insert formula and copy down column

    Hi,

    What I would like is a macro that enters a formula in H2 i.e. =G2+1 and copies down column H until it reaches the last ‘Row‘ with data in it i.e. the rows all have data in cells A through to Q.


    Any assistance would be greatly appreciated

    Many thanks in advance


    Rob

    N.B. Excel version 2003
    Rob

  2. #2
    Forum Contributor
    Join Date
    01-24-2011
    Location
    Sheppey
    MS-Off Ver
    Excel 2010
    Posts
    239

    Re: Macro to insert formula and copy down column

    Rob, not sure if it works in 2003 but works in 2007/2010. If you have data in 4 rows in column G2 to G5 add the formula to H2 (=G2+1) and drag it down to H5 when you enter a new number to G6 the formula will automatically follow, so no need for macros. In the file advance option settings you must have the "Extend data range formats and formulas" option selected on.

  3. #3
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    Posts
    465

    Re: Macro to insert formula and copy down column

    BarryTSL,

    thanks for the advice but the macro code is required as it will be included in a larger macro to fully automate the process.


    Regards


    Rob

  4. #4
    Forum Contributor
    Join Date
    01-24-2011
    Location
    Sheppey
    MS-Off Ver
    Excel 2010
    Posts
    239

    Re: Macro to insert formula and copy down column

    I have put some code in modula 2 that may be some help to you.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    Posts
    465

    Re: Macro to insert formula and copy down column

    BarrTSL

    EXCELLENT !!! Many thanks


    Regards



    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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