Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default Supress Rows Before Printing - Toolbar Icons become disable

I have used the following Macros from the Discussoion Group in Excel 2007 to
supress printing of Row 1 to 5.

Private Sub Workbook_BeforePrint(Cancel As Boolean)

' Hide Row 1 to Row 5 when printing

If ActiveSheet.Name = "Adjustment" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Rows("1:5").EntireRow.Hidden = True
.PrintOut
.Rows("1:5").EntireRow.Hidden = False
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub

However, after I clicked "Print Preview", all toolbar icons are disable for
selection. I can only get out from pressing the "Esc' key.

When I take out the above Macro, selection becomes available.

Hope someone can help.

Thanks.

Igbert

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 515
Default Supress Rows Before Printing - Toolbar Icons become disable

You can delete the .Printout line, and replace it with
Application.Dialogs(xlDialogPrint).Show.
That brings up the normal excel print dialog form, which allows you to
select printers, page nrs, and to preview.

Then remove the period in front of Rows in the next line

--
HTH

Kassie

Replace xxx with hotmail


"igbert" wrote:

I have used the following Macros from the Discussoion Group in Excel 2007 to
supress printing of Row 1 to 5.

Private Sub Workbook_BeforePrint(Cancel As Boolean)

' Hide Row 1 to Row 5 when printing

If ActiveSheet.Name = "Adjustment" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Rows("1:5").EntireRow.Hidden = True
.PrintOut
.Rows("1:5").EntireRow.Hidden = False
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub

However, after I clicked "Print Preview", all toolbar icons are disable for
selection. I can only get out from pressing the "Esc' key.

When I take out the above Macro, selection becomes available.

Hope someone can help.

Thanks.

Igbert

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default Supress Rows Before Printing - Toolbar Icons become disable

Hi Kassie,

Thanks for the solution.

Is there a way to use this macro for printing different worksheets
depressing different rows within the same workbook.

Thanks,

Igbert

"Kassie" wrote:

You can delete the .Printout line, and replace it with
Application.Dialogs(xlDialogPrint).Show.
That brings up the normal excel print dialog form, which allows you to
select printers, page nrs, and to preview.

Then remove the period in front of Rows in the next line

--
HTH

Kassie

Replace xxx with hotmail


"igbert" wrote:

I have used the following Macros from the Discussoion Group in Excel 2007 to
supress printing of Row 1 to 5.

Private Sub Workbook_BeforePrint(Cancel As Boolean)

' Hide Row 1 to Row 5 when printing

If ActiveSheet.Name = "Adjustment" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Rows("1:5").EntireRow.Hidden = True
.PrintOut
.Rows("1:5").EntireRow.Hidden = False
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub

However, after I clicked "Print Preview", all toolbar icons are disable for
selection. I can only get out from pressing the "Esc' key.

When I take out the above Macro, selection becomes available.

Hope someone can help.

Thanks.

Igbert

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
Supress rows AmyLRuck Excel Discussion (Misc queries) 5 October 5th 08 10:49 PM
Shortcuts to toolbar icons? John Bundy Excel Discussion (Misc queries) 1 January 3rd 07 03:38 PM
How do I supress printing of text in certain cells of Excel 2003? jczr53 Excel Discussion (Misc queries) 2 July 3rd 06 01:45 AM
Toolbar icons candrus Setting up and Configuration of Excel 1 June 2nd 06 06:33 PM
Toolbar icons Weece Excel Discussion (Misc queries) 1 May 21st 06 12:20 PM


All times are GMT +1. The time now is 02:33 AM.

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"