PDA

View Full Version : Solved: AutoPrint a worksheet



ermis1975
02-15-2009, 10:00 AM
I have make a macro and calculate subtotals. Until now I select manualy all active cells and print.
I want to run a macro and print automaticaly ,to the default printer, all active worksheet (max 3 pages).

mdmackillop
02-15-2009, 10:24 AM
Two choices. Slightly different outcomes for page numbering in headers/footers

Sub Prints()
For i = 1 To Sheets.Count
Sheets(i).PrintOut
Next
End Sub

Sub Prints2()
Sheets(Array(1, 2, 3)).PrintOut
End Sub

ermis1975
02-15-2009, 10:55 AM
Maybe I have made a mistake! I meen to print only one worksheet. And (if it helps the max of pages will be 3 and the columns 5.
Thanks!

mdmackillop
02-15-2009, 12:00 PM
If you have set your PrintArea correctly then use
ActiveSheet.PrintOut

Recording a simple macro for such tasks will give you the basic code.