Thread: Prerinted forms
View Single Post
  #4   Report Post  
Rob van Gelder
 
Posts: n/a
Default

I realised shortly after posting that is wasn't quite that straightforward.
Sorry.

Assuming your Worksheets are named OnScreen and OffScreen...
The Workbook Event code should look more like this:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Static blnScreen_Override As Boolean

If ActiveSheet Is Worksheets("OnScreen") And Not blnScreen_Override Then
blnScreen_Override = True
Cancel = True
Worksheets("OffScreen").PrintOut
blnScreen_Override = False
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Rob van Gelder" wrote in message
...
What you could do is create a special hidden sheet specifically for the
purpose of printing.
The hidden sheet is formatted for printing. Any values are formulas
referencing the onscreen sheet.

The workbook event BeforePrint could be used to trap and print the hidden
sheet instead:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets("Sheet2").PrintOut
End Sub

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Arthur F. Dunn, M.D." wrote in message
...
I am currently using Excel in Office 2000. Is it possible to create a form
on screen and designate the form labels as non-printing while the data
cells
would print? i.e this would be necessary to use an on-screen form with a
preprinted form. I can hide the label cells but then they disappear from
view, defeating the usefulness of the on-screen form. Would a later Excel
version offer this capability?