Hi yoko21
Play with this
Option Explicit
Sub SubTot()
Dim LR As Long, LR1 As Long
With Sheets("Sheet1")
'Find Last Row in Column A With Data (plus 1)
LR1 = .Range("A" & .Rows.Count).End(xlUp).Row + 1
'Find True Last Row With Data (plus 3)
LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 3
'Clear Data from Column B below LR1 (the Old Formula)
.Range("B" & LR1 & ":B" & LR).ClearContents
'Find the New True Last Row (plus 3)
LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 3
'Put this Formula in that Cell
.Range("B" & LR).Formula = "=SUBTOTAL(109,B2:B" & LR - 3 & ")"
End With
End Sub
Bookmarks