View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Setting Print Area

You could do this

Alt+f11 to open VB editor. Double click 'This workbook' and paste this in

Private Sub Workbook_BeforePrint(Cancel As Boolean)
If Sheets("Sheet1").Range("A1").Value = 1 Then
ActiveSheet.PageSetup.PrintArea = "$B$1:$B$10"
ElseIf Sheets("Sheet1").Range("A1").Value = 2 Then
ActiveSheet.PageSetup.PrintArea = "$C$1:$C$10"
Else
Cancel = True
End If
End Sub

Mike

"Mike" wrote:

Hi,
Is it possible to set/reset the print area according to a cell value?

e.g.:-
if A1 = 1 then set print area to B1:B10
if A1 = 2 then set print area to C1:C10
etc.
TIA
Mike