Hiding Columns/Rows for printing, also a header question

  • Thread starter Thread starter CEN7272 - ExcelForums.com
  • Start date Start date
C

CEN7272 - ExcelForums.com

I have a list with about 8 columns and 300 rows. Normally this shee
is viewded on a computer but sometimes it may need to be printed.
want to print all the rows but only 6 of the columns. because th
sheet is viewed/printed by several users, I would like to do thi
without having to hide the columns everytime it is printed. Is ther
a way to select specific rows/colums so that they are viewable but no
printable

Also, at the top of the list I have a key (5R x 6C) which is frozen s
that it can be used for the entire sheet. Is it possible to have thi
printed at the top of each page (as a header

I'd appreciate any help for either question
Cla
 
Hi Clay

re Q1: no, you can't nominate columns as viewable but not printable, however
you can make it easier for the columns to be hidden or the document printed
- option 1 - if the columns that you don't want printed are next to each
other, select the columns and choose data / group and outline / group ...
now when they need to be hidden click on the little - and they will be
hidden, when you want them back again click on the + and they will appear
- option 2 - create two custom views - an "on-screen" one and a "print" one
... .to create the "on-screen" one, leave all the columns unhidden and choose
view / custom views / add - give it a name and click Ok. To create the
"print" one, hide the relevant columns, chose view / custom views / add -
give it a name, ensure both check boxes are checked, click OK. You can then
record a macro displaying the print one and another macro dispalying the one
screen one - and create toolbar buttons to switch between the two different
views

re Q2: to set rows to repeat at the top of every printed page, choose file /
page setup / sheet tab, click in rows to repeat at top, then click on the
row numbers for what you want repeated and then click Ok

hope this helps, please post back if you require more details

Cheers
JulieD
 
One way, using an event macro.

Put this in the ThisWorkbook code module. Change the Sheet name and
columns to suit:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
Application.EnableEvents = False
For Each ws In ActiveWindow.SelectedSheets
If ws.Name = "Sheet1" Then
ws.Range("F:F", "J:J").EntireColumn.Hidden = True
ws.PrintOut
ws.Range("A:K").EntireColumn.Hidden = False
Else
ws.PrintOut
End If
Next ws
Application.EnableEvents = True
End Sub

(e-mail address removed)-spam.invalid (CEN7272 - ExcelForums.com)
wrote:
 
Thanks to both of you, the VB code worked perfectly and the
suggestion for printing the key on all pages was exactly what I was
looking for. Also, thanks for the speedy reply
Clay
 
Back
Top