Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default setting complex print area

Hi

Can you not format the area you do not want printed to ....
Range("D5:D10").NumberFormat = ";;;"
and reinstate the correct format after printing.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
Application.EnableEvents = False
'Remove the following line below when you do the range printed
Range("D5:D10").NumberFormat = ";;;"
ActiveSheet.PageSetup.PrintArea = _
"$C$3:$D$19,$F$12:$H$22,$J$20:$L$31,$F$32:$G$41,$B $35:$D$47"
ActiveSheet.PrintOut
Range("D5:D10").NumberFormat = "#,##0 ;[Red](#,##0)"
Application.EnableEvents = True
End Sub



--
XL2002
Regards

William


"Wild Bill" wrote in message
...
| I am trying to hide or "mask out" a section of a sheet from printing.
| E.g. I want to prevent B5 through D10 from printing. I do *not* want to
| do so permanently, so just building a print area with control-clicks is
| no good (if that even works).
|
| I'll use VBA to toggle it. The nuisance here is that the shape of the
| rest that I DO want to print is odd, making me need to specify the print
| area as something like
| "A:A;B1:D4;B11:D65535;E:IV"
| which, even if that works, is too hardcoded (e.g. what if I modify the
| range to be masked?).
|
| Well I did set up a range for the masked area but still don't know how
| to hide it from printing.
| Range properties considered:
| .hidden: only works for full rows or columns
| .visible: is not a property for ranges
| .characters: This has promise. Maybe I can switch the color to white
| during printing.
|
| Changing column widths: Nope, affects cells above and below my
| mask-range.
|
| Am I missing the obvious solution?


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
Print Area Setting RozBuds Excel Discussion (Misc queries) 3 February 19th 10 09:41 PM
Setting The Print-Area ? Robert11[_3_] New Users to Excel 2 May 31st 09 03:24 PM
Setting print area richzip Excel Discussion (Misc queries) 1 April 27th 08 08:10 AM
setting the print area from a macro Joe Farruggio Excel Worksheet Functions 10 November 25th 06 01:10 AM
setting complex print area Myrna Larson[_2_] Excel Programming 3 August 18th 03 04:37 PM


All times are GMT +1. The time now is 05:16 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"