Попробуйте это
Option Explicit
Sub OTC_filter()
Dim ot As Worksheet, lr As Long, elr As Long, i As Long
Application.ScreenUpdating = False
Set ot = Worksheets("OTCDD")
lr = ot.Cells(Rows.Count, 26).End(xlUp).Row
For i = 2 To lr
If WorksheetFunction.And(WorksheetFunction.IfError(Cells(i, "AE"), False) = True, (Cells(i, "Z") = Cells(i, "M"))) = True Then
Cells(i, "S") = Cells(i, "Z")
End If
Next
Application.ScreenUpdating = True
End Sub