Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
TM TM is offline
external usenet poster
 
Posts: 8
Default How can i auto hide empty rows in printing in excel?

How can I auto hide empty rows in printing a table in excel?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 510
Default How can i auto hide empty rows in printing in excel?

Hi

In case all empty rows are at bottom of your table (I.e. you prepared some
table - entered formulas, formatted cells, etc. - and are now entering data,
then define a named range Print_Area for this sheet as a dynamic range, in a
way the range includes the rows with data only.

When you have empty rows between filled ones, then your luck is running out
IMHO.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"TM" wrote in message
...
How can I auto hide empty rows in printing a table in excel?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,600
Default How can i auto hide empty rows in printing in excel?

To do that totally automatically would require some VBA (in the BeforePrint
event in the ThisWorkbook module). Without code and not quite automatic try
this

Ensure there's at least one row above your table
Say your Table is in C2:J20
In a helper column either to left or right of your table, let's say in Col-B
B1: "nonEmpty" or whatever you want but not empty
B2: =COUNTIF(C2:J2,"")
- copy down to at least to the bottom of your table or beyond
- each cell should return the number of non empty cells
select B1
Data, Filter, AutoFilter

When you want to print, select the filter arrow in B1 and "0"
Blank rows should hide

When done reset the filter to All or clear it completely from the same Data
menu

Previously you should have set your print-area to exclude the helper column
and top filter row, probably just your table in C2:J20

Regards,
Peter T


"TM" wrote in message
...
How can I auto hide empty rows in printing a table in excel?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How can i auto hide empty rows in printing in excel?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then
Rows(r).EntireRow.Hidden = True
End If
Next r
End Sub


Gord Dibben MS Excel MVP

On Fri, 1 Aug 2008 02:25:00 -0700, TM wrote:

How can I auto hide empty rows in printing a table in excel?


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 empty rows in pivot table Excel 2003 menda Excel Discussion (Misc queries) 2 February 20th 08 12:16 PM
Is there a way to automatically hide empty rows? Christine Excel Worksheet Functions 1 April 12th 07 10:22 PM
Hide Empty Rows When Printing Bob Excel Worksheet Functions 5 August 20th 05 12:57 PM
Want to auto hide rows in excel when no data in a certain column. Tim Excel Discussion (Misc queries) 3 June 30th 05 12:52 AM
Format to hide empty rows tamato43 Excel Discussion (Misc queries) 4 May 10th 05 10:16 PM


All times are GMT +1. The time now is 03:03 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"