Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dropping blank pages from Excel Spreadsheet's Printout


Hello everyone,

I decided to re-post my question since it was ignored the first time.
Maybe I'll get lucky on second attempt. I just wonder, is this question
so not interesting to the Forum members?

So, here I go again.
I hope that somebody has had experience with what I have to accomplish.
I'd really appreciate any ideas and tips on that. Code samples - dream
come true.
So here goes.
After applying specific page settings to spreadsheet - could be
multiple spreadsheets in a workbook - before printing, it gets broken
down into certain amount of pages - or print areas - and some of these
could contain nothing but grid lines and columns' headers. So they
essentially are blank. And sometimes there could be as many as 100s of
these pages depending on the number and width of columns in the
spreadsheet, and we have to either manually reformat Excel files to get
rid of blank pages, or just pull out, again manually, all these pages
from paper printout, which is very annoying and time-consuming.
Is there a way to programmatically find these blank pages and exclude
them from printing? We're talking about processing of 100s of Excel
files at a time - hense, batch printing.

Thank you in advance.


--
sgluzberg
------------------------------------------------------------------------
sgluzberg's Profile: http://www.excelforum.com/member.php...o&userid=23528
View this thread: http://www.excelforum.com/showthread...hreadid=375598

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dropping blank pages from Excel Spreadsheet's Printout

If you define a print area for each sheet, then that can overcome your
problem if you only pick populated ranges to be in your print area.

Without knowing specifics about how your data is laid out, it would be hard
to offer any more specific.

one problem you probably have is that you have unused space being seen as
used by Excel. Look at Debra Dalgleish's information on correcting this
problem:

http://www.contextures.com/xlfaqApp.html#Unused

--
Regards,
Tom Ogilvy


"sgluzberg" wrote
in message ...

Hello everyone,

I decided to re-post my question since it was ignored the first time.
Maybe I'll get lucky on second attempt. I just wonder, is this question
so not interesting to the Forum members?

So, here I go again.
I hope that somebody has had experience with what I have to accomplish.
I'd really appreciate any ideas and tips on that. Code samples - dream
come true.
So here goes.
After applying specific page settings to spreadsheet - could be
multiple spreadsheets in a workbook - before printing, it gets broken
down into certain amount of pages - or print areas - and some of these
could contain nothing but grid lines and columns' headers. So they
essentially are blank. And sometimes there could be as many as 100s of
these pages depending on the number and width of columns in the
spreadsheet, and we have to either manually reformat Excel files to get
rid of blank pages, or just pull out, again manually, all these pages
from paper printout, which is very annoying and time-consuming.
Is there a way to programmatically find these blank pages and exclude
them from printing? We're talking about processing of 100s of Excel
files at a time - hense, batch printing.

Thank you in advance.


--
sgluzberg
------------------------------------------------------------------------
sgluzberg's Profile:

http://www.excelforum.com/member.php...o&userid=23528
View this thread: http://www.excelforum.com/showthread...hreadid=375598



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dropping blank pages from Excel Spreadsheet's Printout


Hello Tom,

Thanks for your reply.
My problem is that I don't know in advance how the data in spreadsheets
will be laid out. We're getting 1000s of Excel files for conversion to
TIFF images. All of them are just files without any specific layout.
There's no patterns or templates.
So the solution must be as generic as possible because I don't think it
would be a good idea to format - even programmatically - each worksheet
of each workbook individually. It would take too much time, and time is
an issue here. So, I think some print settings - scaling, margins etc. -
should be the same for all of the files.
You're saying that I need to set a Print Area for spreadsheet and print
only populated ranges to overcome my problem, but this is what I'm
trying to figure out - how to print only populated ranges?

Thanks.


--
sgluzberg
------------------------------------------------------------------------
sgluzberg's Profile: http://www.excelforum.com/member.php...o&userid=23528
View this thread: http://www.excelforum.com/showthread...hreadid=375598

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dropping blank pages from Excel Spreadsheet's Printout

Sub PrintActiveWorkbook()
Dim sh As Worksheet
Dim rng As Range
For Each sh In ActiveWorkbook.Worksheets
sh.Activate
If Application.CountA(sh.Cells) < 0 Then
Set rng = GetRealLastCell()
ActiveSheet.Range("A1", rng).PrintOut
'Debug.Print ActiveSheet.Range("A1", rng).Address(external:=True)
End If
Next
End Sub


Function GetRealLastCell() As Range
Dim RealLastRow As Long
Dim RealLastColumn As Long
Range("A1").Select
On Error Resume Next
RealLastRow = _
Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
RealLastColumn = _
Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column
Set GetRealLastCell = Cells(RealLastRow, RealLastColumn)
End Function



--
Regards,
Tom Ogilvy


"sgluzberg" wrote
in message ...

Hello Tom,

Thanks for your reply.
My problem is that I don't know in advance how the data in spreadsheets
will be laid out. We're getting 1000s of Excel files for conversion to
TIFF images. All of them are just files without any specific layout.
There's no patterns or templates.
So the solution must be as generic as possible because I don't think it
would be a good idea to format - even programmatically - each worksheet
of each workbook individually. It would take too much time, and time is
an issue here. So, I think some print settings - scaling, margins etc. -
should be the same for all of the files.
You're saying that I need to set a Print Area for spreadsheet and print
only populated ranges to overcome my problem, but this is what I'm
trying to figure out - how to print only populated ranges?

Thanks.


--
sgluzberg
------------------------------------------------------------------------
sgluzberg's Profile:

http://www.excelforum.com/member.php...o&userid=23528
View this thread: http://www.excelforum.com/showthread...hreadid=375598



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
a blank page appears at the end of a printout in excel Steven Excel Discussion (Misc queries) 2 November 26th 08 05:13 PM
How do I delete pages in Excel? Keeps printing blank pages at end. Jojobean Charts and Charting in Excel 1 May 31st 07 07:37 AM
Im trying to remove blank rows in an Excel spreadsheet Printout riponalong Excel Worksheet Functions 2 January 5th 06 05:58 AM
Why is my Excel spreadsheet's sorting not being remembered? LisaSellsBabyCloths Excel Discussion (Misc queries) 0 July 2nd 05 09:29 PM
How do I keep from printing blank pages in excel? Davbwalker Excel Discussion (Misc queries) 1 April 19th 05 06:37 PM


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