Hide Macro

E

Esrei

I want a macro that

I have a speadsheet A65536:L65536
If the value in a cell (a3) in A = the value of the cell
above that cell (a2)excell must hide the row with the
value = to the above row?
 
F

Frank Kabel

Hi
Try:
Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 2 Step -1
If Cells(RowNdx, "A").Value = _
Cells(RowNdx-1, "A").Value Then
Rows(RowNdx).Hidden = True
End If
Next RowNdx
End Sub
 
Top