LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default printpreview

I'm using the following code to prevent the empty rows printing.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "Initiatives" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
On Error Resume Next
.Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden =
True
.PrintOut
.Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden =
False
On Error GoTo 0
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
But, when I'm trying to use the code below to get a preprint report it's not
working.
ActiveWindow.SelectedSheets.PrintPreview

Could anybody advise how I could make it's working?

Thanks
 
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
PrintPreview Gerry Verschuuren Excel Discussion (Misc queries) 5 October 23rd 07 06:24 PM
PrintPreview Zoom CG Rosén Excel Programming 3 August 19th 05 04:45 AM
PrintPreview doesn't work Roy Barr Excel Programming 2 March 28th 05 01:22 PM
PrintPreview Question JimP Excel Programming 2 November 12th 04 02:47 PM
printpreview freezing GregJG[_10_] Excel Programming 0 July 4th 04 12:01 AM


All times are GMT +1. The time now is 11:58 PM.

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

About Us

"It's about Microsoft Excel"