Unhiding columns

  • Thread starter Thread starter Ian Coates
  • Start date Start date
I

Ian Coates

I have a spreadsheet with more columns than need printing. I can hide these
using Workbook_BeforePrint.

I can not find a way to automatically Unhide these columns after printing or
closing Print Preview.

Can anyone offer a suggestion?
 
You could set an ontime macro to run a few seconds after the printing
starts, and include the code in the beforeprint event:

Application.OnTime (Now() + TimeSerial(0, 0, 3)), "ShowColumns"

and in a regular module:

Sub ShowColumns
Cells.EntireColumn.Hidden = False
end sub

Bob Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
..
 
Thanks Bob

I'm not familiar with this procedure. Presumably it relies on the print
staring before the macro runs. How would this work if Print Preview is
selected first? The columns are hidden in the preview, but if the macro runs
before Print is selected, what would happen?
 
Back
Top