Select Wich Cells To Include In Print

M

Mathew P Bennett

Good Evening All,
Excel 2007.
I have a ss (report), in which I have included notes for the user, eg 'click
on button to refresh data'. These notes have been placed directly in
available cells, (ie are not n a comment).
I would like to exclude these note ranges eg D4:F4, (note in D4 but carries
over into F4) from appearing in the printed version.
Is this possible, or do I have to use a comments box, & then clickon the not
to show in print option?

Cheers Guys,
Mathew
 
B

Bob Umlas, Excel MVP

Let's say that in addition to D4, you also want to hide F6 (for example).
In the VBE, double-click on the Thisworkbook object, post this code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range("D4,F6").Font.ColorIndex = 2
Application.OnTime Now, "RESTORE"
End Sub
In a regular module, put this:
Sub Restore()
Range("D4,F6").Font.ColorIndex = -4105
End Sub

HTH
 
M

Mathew P Bennett

Thanks Bob, I thought here would be a VBA solution. I take it, on selecting
print, it changes the font of the selected cells/range to white, and
restores to normal, once print is done.
Cheers agian. M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top