Just a minor change in your code should do it...
==================
Dim lRow As Long
lRow = Selection.Row
If lRow <= 5 Then Exit Sub
Range(Rows(lRow), Rows(Selection.End(xlDown).Row)).EntireRow.Hidden = True
================================================== =========
you could also use:
Range(Rows(Selection.Row), Rows(Selection.End(xlDown).Row)).EntireRow.Hidden
= True
(works in Excel 2000)
--
steveB
Remove "AYN" from email to respond
"helmekki" wrote in
message ...
Hi there
i want to hide from lRow Down to the last used Cell.
I tried to modify this code , but could not make it work.
Code:
--------------------
Sub Macro2()
Dim lRow As Long
lRow = Selection.Row
If lRow <= 5 Then Exit Sub
Rows("lRow:" & Selection.End(xlDown)).EntireRow.Hidden = True
End Sub
--------------------
an idea ?
--
helmekki
------------------------------------------------------------------------
helmekki's Profile:
http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=377831