Various options ... if you want to avoid using the Calculate event then you would need to provide more info. with regard to how Col D on this sheet is affected by changes elsewhere. If you rely on the Calculate event then you will need to process all rows with each calculation, however, you can avoid iteration using AutoFilter etc or using temp formulae, an example of the latter
Public Sub Worksheet_Calculate()
Dim xlCalc as XLCalculation
On Error GoTo ExitPoint
With Application
xlCalc = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
End With
With Range("D10:D1425")
.EntireRow.Hidden = False
With .Offset(,Columns.Count - .Column)
.FormulaR1C1 = "=IF(RC4=""-"",""X"",0)"
On Error Resume Next
.SpecialCells(xlCellTypeFormulas,xlTextValues).EntireRow.Hidden = True
On Error GoTo ExitPoint
.Clear
End With
End With
ExitPoint:
With Application
.Calculation = xlCalc
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
To insert the above right click on the tab in question select View Code and paste above into resulting window. As and when this sheet is recalculated so the row visibility will update accordingly. Note altering row visibility is volatile hence the toggling of App level settings.
Bookmarks