PDA

View Full Version : [SOLVED:] Formula Not Copying to Last Row



BenChod
07-12-2017, 07:45 AM
Hi all -

I have the following two lines of code where I want to copy a formula all the way down to the last row in the column. The problem I am facing is that the formula is being copied to the first to rows in column M. Hoping someone can take a quick look and let me know what I am doing wrong.


lastrow3 = Sheets("QC").Range("M" & Rows.Count).End(xlUp).Row
Range("M3:M" & lastrow3).Formula = "=DATEDIF(RC[-1],TODAY(),""d"")"

BenChod
07-12-2017, 09:01 AM
I was able to figure out the issue. Here is the code that I used for the fix in case anyone needs something similar:


Range("K2:K" & Range("J" & Rows.Count).End(xlUp).Row).Formula = "=DATEDIF(J2,TODAY(),""d"")"