View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
William[_2_] William[_2_] is offline
external usenet poster
 
Posts: 227
Default Print macro for multiple ranges/sheets

Hi Deeds

I'm unsure exactly what you are trying to do - if you are NOT attempting to
print all the ranges to one sheet does this help?

Sub Test()
With Sheets("Sheet1").PageSetup
..PrintArea = "$B$5:$D$29,$E$42:$G$54,$H$14:$J$34,$M$16:$N$3 0"
End With
With Sheets("Sheet2").PageSetup
..PrintArea = "$C$10:$F$33,$I$5:$L$19,$H$36:$L$52"
End With
With Sheets("Sheet3").PageSetup
..PrintArea = "$B$6:$E$19,$H$14:$J$26"
End With
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).PrintPreview
ActiveSheet.Select
End Sub

If your print ranges are already defined you can reduce the above to.....

Sub Test()
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).PrintPreview
ActiveSheet.Select
End Sub

--
XL2002
Regards

William



"Deeds" wrote in message
...
| I am trying to write a macro that prints/previews multiple ranges across
several sheets. Any ideas?
| Thanks