Suppress printing a column (advanced question)

clay5000

New Member
Joined
Sep 10, 2008
Messages
48
I have a list of customers to send to branch offices. One column has personal customer info that I want visible on the screen, but I don't want printed on paper. I made it the last column, and set the column page break to exclude the column, but the branch offices are too smart, and reset the column page break to include the last column. So my question is whether there is any way to give a column some "property" so it isn't visible on printing, or some other method to accomplish the same thing?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi clay5000,

Try

Code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets(1).Columns("K:K").EntireColumn.Hidden = True
End Sub

Code:


Change the Sheet Ref & Column Ref to suit your requirements.

This will hide the Column before the Print.

But it will leave the column Hidden when printings complete, if you want to restore the column, add the following in a standard module.

Code:

Sub Show()
Sheets(1).Columns("K:K").EntireColumn.Hidden = False
End Sub

Code:

You'll then need to assign the Show Macro to a Ctrl+Key combination.

ColinKJ
 
Upvote 0

Forum statistics

Threads
1,203,630
Messages
6,056,422
Members
444,863
Latest member
powerdt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top