Вот мой код:
Sub SubChangeAutofilteredValues()
'Declarations.
Dim RngRange01 As Range
Dim StrOldValue As String
Dim StrNewValue As String
'Setting variables.
StrOldValue = "N"
StrNewValue = "K"
'Autofiltering.
ActiveSheet.AutoFilter.Range.AutoFilter Field:=1, Criteria1:=StrOldValue
'Verifying if any match has been found.
If Cells(ActiveSheet.AutoFilter.Range.Rows.Count + 1, 1).End(xlUp).Row = 1 Then
MsgBox "No records found.", , "No records found"
Exit Sub
End If
'Setting the variable.
With ActiveSheet.AutoFilter.Range
Set RngRange01 = .Resize(.Rows.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible)
End With
'Changing the values.
RngRange01.Value = StrNewValue
End Sub