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
 
D

David McRitchie

Hi Esrei (e-mail address removed)
You can get practically the same effect as hiding rows with filters,
so you might want to check that also as an alternative.
See Debra Dalgleish's pages
http://www.contextures.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top