Это должно сработать, так как вы никогда не знаете, с чего начать писать свое «Да»:
Option Explicit
Sub Test()
'Assuming you are running the code on the same workbook it is written
'change SheetName for the sheet name where you want it to run,
'if not, change also ThisWorkbook for Workbooks("WorkbookName.Extension")
Dim ws As Worksheet: Set ws = ThisWorkbook.Sheets("SheetName")
With ws
'This is to get the last row with data, so change Z for whichever column
'has the last row with data
Dim LastRow As Long: LastRow = .Cells(.Rows.Count, "Z").End(xlUp).Row
'This gets the last column with data, assuming you have all your headers in row 1
Dim LastCol As Long: LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
'Put your whole range into a variable
Dim FilterRange As Range: Set FilterRange = .Range("A1", .Cells(LastRow, LastCol))
'Filter by your criteria
FilterRange.AutoFilter 1, "No"
FilterRange.AutoFilter 3, "Yes"
'Now find the first row without data in column AB
Dim FirstRow As Long
LastRow = .Cells(.Rows.Count, "Z").End(xlUp).Row
Set FilterRange = .Range("AB2:AB" & LastRow)
Dim cell As Range
For Each cell In FilterRange
If cell.EntireRow.Hidden = False Then
FirstRow = cell.Row
Exit For
End If
Next cell
'Fill all your visible cells in Range AB with Yes
.Range("AB" & FirstRow & ":AB" & LastRow).SpecialCells(xlCellTypeVisible) = "Yes"
End With
End Sub