Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Rows From a Row to Last usedCell.Row


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Rows From a Row to Last usedCell.Row


Good evening Helmekki

Slight departure from your code, but it's neat and seems to work OK.
It actually hides the rows from the currently active cell row right u
to the last row containing information.

Sub Test()
lastrow = ActiveSheet.UsedRange.Rows.Count + 1
nowrow = ActiveCell.Row + 1
For f = nowrow To lastrow
Rows(f).Select
Selection.EntireRow.Hidden = True
Next f
End Sub

Is that any good to you?

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=37783

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide Rows From a Row to Last usedCell.Row


Oh God..................

Thank u very very much..............

:) :) :)


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=377831

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Group rows (or hide rows) like in MS Project Annie1904 Excel Worksheet Functions 2 October 17th 09 05:15 AM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
cut rows without cutting hide rows מיכל Excel Discussion (Misc queries) 1 June 25th 07 02:01 PM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 12:39 AM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"