Hi
I am Using the following macro code to fill down a formula in "Sheet2" for a certain number of rows. The certain number of rows is based on the number of rows in "Sheet1" column A.
Sub update()
Dim lStop As Long
With Worksheets("Sheet1")
lStop = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Worksheets("Sheet2").Range("4:" & lStop).FillDown
End Sub
This works great except for when I delete a row in Sheet1. What happens then is that I get duplicates or errors at the buttom of Sheet 2. I was planning to solve this by adding to the existing macro a command that "clearcontents" of the cells after "lStop" in Sheet2. (Since the number of rows in "Istop" gets fewer when I delete a row in Sheet1 I am left with old formulas in bottom cells of Sheet2 which I want to clear)
Any suggestions of how to do this?
Best Regards
Bookmarks