+ Reply to Thread
Results 1 to 6 of 6

Macro to copy formula in D1 all the way down column ‘D’ until the first empty cell

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Macro to copy formula in D1 all the way down column ‘D’ until the first empty cell

    Hi,

    I am after the Macro code to copy a formula in cell D1 all the way down column ‘D’ until it the first empty cell is detected and then stop.

    Excel version 2003

    Any assistance in this matter would be greatly appreciated

    Many thanks

    Rob
    Rob

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475
    Hi,
    Give this a try,
    It copies the data from column D and pastes to the first empty row in column A on Sheet 2
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    This single command will do what you have asked for

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Unhappy Copy formual in D1 to first empty cell in Colum D

    Dave,

    thanks for the prompt reply but what I'm after is this…

    I have to copy the formula in D1 down to the next empty cell in Colum ‘D’ this may be 100 rows down to D100 or even further D2000, D4000 etc, but I don’t know in colum ‘D’ where the empty cell may fall !!


    Rob

  5. #5
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Requirements slightly changed

    davesexcel / mudraker

    Having revisited my logic I now realise that the cells in column ‘D’ will be empty anyway so what I need now is the formula in D1 copied all the way down column ‘D’ until another formula is found (this may be 100’s of rows down to D100 or even further D2000, D4000 etc.

    Many thanks

    Rob

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    robertguy

    Did you try my code because it does exectly what you are asking for
    Copy formula in d1 & places it into d2 to the row above the next entry in column D regardless if the next entry is in d3, d100, d200

    example next enrry in column D is d150 the single commad will place formula in d2 to d149

+ 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