Printing

  • Thread starter Thread starter Sophia
  • Start date Start date
S

Sophia

If you have two columns that are frozen in a worksheet and
then you have additional columns to the left of them. How
you print your frozen panes with one of the other columns
only and have each set on the same page. For example,
column 1& 2 are frozen and you want to print Columns 1, 2,
3 on one page together, then on the next page you want to
print columns 1,2,4 together on a page and so on. How
would you accomplish this. I have tried but can't seem to
get the additional columns like 1,2,4 on a page together
it alway comes up as two seperate pages. Is there a way
to do some type of report to select whatever columsn you
want and have them print on the same page regardless of
where the columns are on the worksheet. Is there a way to
do it without Report Manager. (For some reason, I can't
get that add-in to download on my computer)
Thanks for all of your help.
Sophia
 
If you select two areas and try to print them, then you'll get at least two
sheets of paper.

But if you hide the intermediate columns, then you'll be ok.

So to print columns 1, 2 and 8, just hide 3:7.

You could even use a little macro to assist:

Option Explicit
Sub testme01()

Dim iCol As Long
Dim firstCol As Long
Dim lastCol As Long

firstCol = 3
lastCol = 10

With ActiveSheet
.Range(.Columns(firstCol), .Columns(lastCol)).Hidden = False
For iCol = firstCol To lastCol
.Columns(1).Resize(, iCol).PrintPreview
.Columns(iCol).Hidden = True
Next iCol
.Range(.Columns(firstCol), .Columns(lastCol)).Hidden = False
End With
End Sub


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Dave Peterson wrote
You could even use a little macro to assist:

Hmm...

I tried to adapt this to hide some empty rows in a Workbook_BeforePrint
routine and got some weird results, i.e. only one row showed up in the
preview and I couldn't stop the routine without leaning on the Esc key.

What I want:

Hide any empty rows from 5 thru 37, Print, then Unhide those rows.

Any help?
 
David Turner wrote
Dave Peterson wrote


Hmm...

I tried to adapt this to hide some empty rows in a Workbook_BeforePrint
routine and got some weird results, i.e. only one row showed up in the
preview and I couldn't stop the routine without leaning on the Esc key.

What I want:

Hide any empty rows from 5 thru 37, Print, then Unhide those rows.

Any help?

Never mind. Did some research:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range("A5:A37").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden =
True
Application.OnTime Now(), ThisWorkbook.Name & "!WorkbookAfterPrint"
End Sub

Sub WorkbookAfterPrint()
Range("A5:A37").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden =
False
End Sub

Originally tried the True/False lines in the BeforePrint routine, but
discovered both were executed before the printing took place. Another
post pointed me to the fix:

http://www.rb-ad.dircon.co.uk/rob/excelvba/tips/index.htm
 
Back
Top