View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Learing VBA Learing VBA is offline
external usenet poster
 
Posts: 1
Default Conditional Print Area

Using this same macro, how would you setup the other attributes for print
settings?
Margins
Orientation
Size
Scaling
Quality
Header
Footer
Rows to repeat
Columns to repeat
Gridlines

Thank You
Learning VBA

"Mike H" wrote in message
...
Hi,

You should be able to do something like this. right click yoir sheet tab,
view code and paste the code below in. Edit for your ranges and cell to
monitor.


Private Sub Worksheet_Calculate()
On Error Resume Next
Select Case Range("J1").Value
Case Is = 1
ActiveSheet.PageSetup.PrintArea = "$B$1:$E$20"
Case Is = 2
ActiveSheet.PageSetup.PrintArea = "$F$1:$I$20"
Case Else
End Select
End Sub

Mike
"PhilosophersSage" wrote:

Is there a way to set a conditional print area? I have a spread sheet
that
has several sections and want to print based on a formula. If anyone can
help
thanks in advance!