Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unhiding columns
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? -- Remove NG from my address to send direct. ----- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unhiding columns
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 .. "Ian Coates" wrote in message news:RNTDc.69$Ik4.39@newsfe3-gui... 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? -- Remove NG from my address to send direct. ----- |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unhiding columns
If printpreview is active, then I don't believe it would run. OnTime is not
preemptive. See Chip Pearson's page on Ontime and consult the excel VBA help for information on making ONTime "wait" http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "Ian Coates" wrote in message news:QrUDc.78$Ik4.59@newsfe3-gui... 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? -- Remove NG from my address to send direct. ----- "Bob Flanagan" wrote in message ... 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 . "Ian Coates" wrote in message news:RNTDc.69$Ik4.39@newsfe3-gui... 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? -- Remove NG from my address to send direct. ----- |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unhiding columns
Many thanks to Tom and Bob. It's working a treat.
-- Remove NG from my address to send direct. ----- "Tom Ogilvy" wrote in message ... If printpreview is active, then I don't believe it would run. OnTime is not preemptive. See Chip Pearson's page on Ontime and consult the excel VBA help for information on making ONTime "wait" http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "Ian Coates" wrote in message news:QrUDc.78$Ik4.59@newsfe3-gui... 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? -- Remove NG from my address to send direct. ----- "Bob Flanagan" wrote in message ... 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 . "Ian Coates" wrote in message news:RNTDc.69$Ik4.39@newsfe3-gui... 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? -- Remove NG from my address to send direct. ----- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prevent unhiding columns | Excel Discussion (Misc queries) | |||
Unhiding Columns | Excel Discussion (Misc queries) | |||
Unhiding columns | Excel Discussion (Misc queries) | |||
Unhiding Columns | Excel Discussion (Misc queries) | |||
Unhiding columns | Excel Worksheet Functions |