Я предложу эту оптимизированную процедуру:
Option Explicit
Public Sub HideRowsOOS()
Application.ScreenUpdating = False
With Worksheets("mySheet") 'change as neeeded
Dim lastRow as Long
lastRow = .Cells(.Rows.Count,2).End(xlUp).Row
For Each cell In .Range("B2:B" & lastRow)
If cell.Value = "x" Then
Dim collect as Range
If collect Is Nothing Set collect = cell: Else Set collect = Union(collect, cell)
End If
Next cell
End With
collect.EntireRow.Hidden = True
End Sub