+ Reply to Thread
Results 1 to 6 of 6

Dynamic macro that copies formulas down to rows with nonblank values

  1. #1
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Dynamic macro that copies formulas down to rows with nonblank values

    Hi there
    I want to copy formulas that are in cells d5, i5:n5 down to rows that have non-blank values in column e and/or column f and/or column g. I would like this to happen dynamically so that as soon as a row has a value in any of the aforementioned columns, it has the formulas that are in the aforementioned cells copied into it. So I think that means I need an "event" type macro pasted into the sheet in the VBA project, but I'm not sure.

    There are a couple of potential factors:
    - row 5 is hidden - I suspect it doesn't matter but I'm not sure
    - columns i:n are hidden - I suspect it doesn't matter but I'm not sure
    - the workbook has a macro which, when it is manually executed, copies (replicates) the entire worksheet into the same workbook and I need the solution to work for all copies of the original worksheet created by the macro - hopefully the "event" macro will be replicated by the worksheet replication macro for each copy of the original worksheet.

    I hope I've explained that properly. Thank you for any assistance.
    Stu

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Dynamic macro that copies formulas down to rows with nonblank values

    Hi Stuart-
    1) Do columns E, F, and G contain constants or formulas? (= is a blank truly blank, or actually an empty string ("") returned by a formula)
    2) What kind of data (Text, Numbers, Dates,...)?
    3) What column can be used to reliably find the "last used row"?
    Last edited by leelnich; 01-31-2018 at 11:16 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Dynamic macro that copies formulas down to rows with nonblank values

    Hi there
    1) truly blank
    2) text
    3) no single column because it could be any one of those 3 columns that contains the last used row

    Thanks.

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Dynamic macro that copies formulas down to rows with nonblank values

    OOPS, just noticed the "Dynamic" requirement. I'll try again...
    Try this:
    Please Login or Register  to view this content.
    Last edited by leelnich; 02-01-2018 at 05:24 AM.

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Dynamic macro that copies formulas down to rows with nonblank values

    Ok, try this Worksheet_Change event procedure:
    Please Login or Register  to view this content.
    If your other macro copies the SHEET, not just the data, then the procedure will be copied also, but changes to one will NOT be reflected in the other(s).
    Last edited by leelnich; 02-01-2018 at 06:00 AM.

  6. #6
    Registered User
    Join Date
    02-25-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Office 365
    Posts
    62

    Re: Dynamic macro that copies formulas down to rows with nonblank values

    Works perfectly thanks very much!

+ 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: 3
    Last Post: 08-31-2015, 09:46 AM
  2. Macro that copies & paste-special(Values) non-blank rows
    By Elieson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2015, 12:27 PM
  3. VBA Code copies and pastes the formulas? I only need the values.
    By tysonbly in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-14-2015, 11:20 AM
  4. Macro copies rows based on condition, BUT rows copy in Wrong order. PLEASE HELP!
    By JAllard1990 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2014, 04:33 PM
  5. [SOLVED] VBA to enter various formulas every 10 rows and show dynamic formulas not values
    By faby2203 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2013, 07:05 AM
  6. Problem with macro that inserts a row, and copies formulas but not the values.
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-14-2010, 03:16 PM
  7. Replies: 3
    Last Post: 02-05-2008, 11:13 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