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 and Columns

Hey for finding the last row which has the data you can use th
following.
lastrw = Cells(Rows.Count, "B").End(xlUp).Row

It checks in the column "B" for data and gives the last row.

Based on this, you can use the following for hiding the rows
Sheets("Sheet1").Rows("lastrw:65536").Hidden = True

Hope this helps.

Samee

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide Rows and Columns

As written:
Sheets("Sheet1").Rows("lastrw:65536").Hidden = True

will just give you an error unless you have a defined name "lastrw"

--
Regards,
Tom Ogilvy

"sameerce " wrote in message
...
Hey for finding the last row which has the data you can use the
following.
lastrw = Cells(Rows.Count, "B").End(xlUp).Row

It checks in the column "B" for data and gives the last row.

Based on this, you can use the following for hiding the rows
Sheets("Sheet1").Rows("lastrw:65536").Hidden = True

Hope this helps.

Sameer


---
Message posted from http://www.ExcelForum.com/



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
Hide unused rows and columns kyleb Excel Discussion (Misc queries) 1 March 25th 10 02:24 AM
Hide columns but not the top rows Oceangate Excel Discussion (Misc queries) 8 November 25th 08 05:46 PM
Hide columns and rows delete automatically Excel Worksheet Functions 2 September 25th 07 12:49 AM
Hide / Unhide columns and rows PaulM Excel Discussion (Misc queries) 8 September 6th 07 12:14 AM
Hide rows or columns using + - buttons [email protected] Excel Discussion (Misc queries) 2 July 6th 05 02:56 PM


All times are GMT +1. The time now is 07:18 AM.

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

About Us

"It's about Microsoft Excel"