View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 692
Default Hide Rows From a Row to Last usedCell.Row

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