Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default 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.
-----




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Unhiding columns

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.
-----






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent unhiding columns EvvLittleGiant Excel Discussion (Misc queries) 1 June 16th 09 07:58 PM
Unhiding Columns Garyw Excel Discussion (Misc queries) 4 July 10th 08 03:48 PM
Unhiding columns Anuj Excel Discussion (Misc queries) 7 May 18th 07 02:15 PM
Unhiding Columns RFJ Excel Discussion (Misc queries) 1 January 21st 05 10:28 AM
Unhiding columns jimmyp Excel Worksheet Functions 6 December 30th 04 08:31 PM


All times are GMT +1. The time now is 09:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"