Results 1 to 2 of 2

Thread: hide columns only when printing

  1. #1
    Board Regular
    Join Date
    Aug 2003

    Default hide columns only when printing

    Is there any way in excel to hide a column only when the report is being printed. In other words, I have a couply of columns that I would like to keep on my report, but I don't want them to print. Do I have to manually hide each of these columns when I go to print the document?

  2. #2
    Board Regular LTunnicliffe's Avatar
    Join Date
    May 2003
    Round Rock, TX



    Private Sub Workbook_BeforePrint(Cancel As Boolean)

    Cancel = True
    Application.EnableEvents = False
    ActiveSheet.Columns(1).Hidden = True
    ActiveSheet.Columns(1).Hidden = False
    Application.EnableEvents = True

    End Sub

    Specify the columns you want hidden where I have the Columns(1) line. Put this in the ThisWorkbook module of the VBE (ALT+F11). Let me know if you have problems.

    The numbers don't lie, but sometimes they don't tell the whole truth.

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts