Your recorded code will need editing to something like this. I have assumed the header row is Row 1.
OptionOption Explicit
Sub AddFormula_FiltereRange()
Const sCrit As String = "a" '<- change date here
Dim FilterData As Range
Dim OldValue As String
On Error GoTo exit_handler
With ActiveSheet
If .AutoFilterMode = False Then .Cells(1, 1).AutoFilter
.Range("A1").AutoFilter Field:=4, Criteria1:="=" & sCrit
' On Error GoTo exit_handler
Set FilterData = .Range("A1").CurrentRegion
With FilterData
OldValue = .Cells(1, 7).Value
.Offset(1, 0).Resize(.Rows.Count - 1, _
.Columns.Count).SpecialCells(xlCellTypeVisible).Select
.Columns(7).Formula = "=5*5"
.Cells(1, 7).Value = OldValue
End With
exit_handler:
.AutoFilterMode = False
End With
On Error GoTo 0
End Sub
Bookmarks