View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
sameerce[_22_] sameerce[_22_] is offline
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