Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Using macros to condense a template

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cpasearches@gmail.com - 23 Jan 2008 05:38 GMT
I had a friend that used to do this and damn it if I can find that
file.  Anyway, does anyone know how to condense a spreadsheet using a
macro that can select and hide only the rows that are empty.
ilia - 23 Jan 2008 06:45 GMT
On Jan 23, 12:38 am, cpasearc...@gmail.com wrote:
> I had a friend that used to do this and damn it if I can find that
> file.  Anyway, does anyone know how to condense a spreadsheet using a
> macro that can select and hide only the rows that are empty.

Try this code.

Public Sub hideEmpty()
 Dim rng As Excel.Range
 Dim rngCell As Excel.Range

 With ActiveSheet
   Set rng = Intersect(.UsedRange, .Range("A:A"))
 End With

 For Each rngCell In rng
   If Application.WorksheetFunction.CountA(rngCell.EntireRow) = 0
Then
     rngCell.EntireRow.RowHeight = 0
   End If
 Next rngCell
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.