ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Print Area (https://www.excelbanter.com/new-users-excel/450231-print-area.html)

Nick31

Print Area
 
Hello guys!
Can I have your help; I have an range with data A1:T20. Can you define it as print area if it contains any letters or numbers in cell G10? Thanks!

Claus Busch

Print Area
 
Hi Nick,

Am Tue, 22 Jul 2014 19:25:00 +0100 schrieb Nick31:

Can I have your help; I have an range with data A1:T20. Can you define
it as print area if it contains any letters or numbers in cell G10?


in the code window of your sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) < "G10" Then Exit Sub
PageSetup.PrintArea = IIf(Len(Target) 0, "$A$1:$T$20", "")
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


All times are GMT +1. The time now is 04:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com