Results 1 to 7 of 7

Macro to find first row blank row then write in a formula

Threaded View

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    Springfield, MO
    MS-Off Ver
    2007
    Posts
    42

    Macro to find first row blank row then write in a formula

    Hello Experts!

    I am attempting to write a macro that will locate the first row in column “D” that is blank and then write in this formula: "=SUMIFS([WebStats_Data_Pull.xlsm]Append_Data!C14,[WebStats_Data_Pull.xlsm]Append_Data!C3,C[-1],[WebStats_Data_Pull.xlsm]Append_Data!C1,C[-3],[WebStats_Data_Pull.xlsm]Append_Data!C2,C[-2])".

    I then need to copy it down to autofill to all cells below. I will need to do this for columns D, E and F. I am also getting stuck in the way that my formula currently references specific cells but the destination cell will always be different as it should be updating in the first blank row.

    This is the code that I have so far…

    Sub Formula()
    ‘Finds the first blank row in column D
     Dim WS as WorkSheet
     Dim I As Long, MaxRow1 As Long
    
     Set WS = Worksheet (“Data_Combine.xlsm”)
    MaxRow1 = WS.Range(“D” & WS.Rows.count).End(xlUp).Row + 1 
     Activecell.Formula = "=SUMIFS([WebStats_Data_Pull.xlsm]Append_Data!C14,[WebStats_Data_Pull.xlsm]Append_Data!C3,C[-1],[WebStats_Data_Pull.xlsm]Append_Data!C1,C[-3],[WebStats_Data_Pull.xlsm]Append_Data!C2,C[-2])"
    I really appreciate any help you are able to provide me! Thank you!
    Jbeets
    Last edited by jbeets; 09-22-2016 at 01:52 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to find blank cell paste vlookup formula
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2015, 12:35 PM
  2. Need to write VBA for find the st blank cell and add formula
    By Akatecho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2015, 05:17 AM
  3. Macro to find blank cell below B9 and input formula
    By iblac_788 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2013, 03:56 AM
  4. [SOLVED] macro loop through variable range to find blank, add formula
    By sammar12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2012, 11:39 AM
  5. Replies: 2
    Last Post: 02-17-2012, 03:08 AM
  6. Insert Blank Row-need to write macro
    By james598 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2009, 08:32 PM
  7. Replies: 12
    Last Post: 03-02-2009, 04:36 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