I have done a search and so far I have seen people with my exact same problem but with no real answer to my delimma. I want to insert row and copy the formula. It does copy formula but the reference stays fixed. so if one of the cells say D5+1 the copied row which moves up should say D6+1 but it says D5+1/ therefore instead of having a updated yesterday date, it has the date of two days ago and will remain fix on that date forever. Anyone have any ideas to allow the code to remain relative?
this is the search i have done and nothing
http://www.mrexcel.com/board2/viewtopic.php?t=166435
http://www.mrexcel.com/board2/viewtopic.php?t=179846&highlight=insert+copy
http://www.mrexcel.com/board2/viewtopic.php?t=179518&highlight=insert+rows+formulas
Code:
Set lastRng = cells(Rows.Count, "D").End(xlUp)
Set topRng = Range(lastRng, lastRng.End(xlUp))
For i = topRng.cells.Count To 1 Step -1
If topRng(i).Value = DateAdd("D", -2, Format(Date, "mm-dd-yyyy")) Then
topRng(0 + i).EntireRow.Copy '"1 + " inserts in row below
topRng(0 + i).EntireRow.Insert
'Paste
End If
Next i
this is the search i have done and nothing
http://www.mrexcel.com/board2/viewtopic.php?t=166435
http://www.mrexcel.com/board2/viewtopic.php?t=179846&highlight=insert+copy
http://www.mrexcel.com/board2/viewtopic.php?t=179518&highlight=insert+rows+formulas