Hi there
I have written a macro and on the workbook I have on my machine it works great – macro below – however, my client has problems, so he emailed the workbook back to me.
He opened it in 2007 but saved it as 2003. There are 3 worksheets with the same macro and on 1 it works great, but on the other 2 I get an error. The line oCell.EntireRow.Hidden = True is the problem here. Why would it work on 1 sheet and not on the other 2 sheets ?? On the copy I received from him, it indeed doesn’t work for me too.
It has me baffled…
Please help – Thanks heaps
The macro is
Private Sub Worksheet_Change(ByVal Target As Range)
Dim oCell As Range
If Not Intersect(Range(“d5:d400”), Target) Is Nothing Then
Application.ScreenUpdating = False
For Each oCell In Intersect(Range(“d5:d400”), Target).Cells
If oCell.Value = “Yes” Then
oCell.EntireRow.Hidden = True
End If
Next oCell
Application.ScreenUpdating = True
End If
End Sub