PDA

View Full Version : Solved: Spreadsheet Printing



bopo
01-16-2007, 03:32 PM
Hi people

Basically I want to only print a range of cells, ranging from A1 to J45, I also want to use a 'Print' button on the spreadsheet to do this, any ideas,

And if mutiple printers are present, how to I get a dialog box to appear, which allows users to select different printers :dunno

mdmackillop
01-16-2007, 03:46 PM
Part 1; Try recording a macro setting the required print area

Past 2; http://vbaexpress.com/kb/getarticle.php?kb_id=528

bopo
01-16-2007, 03:56 PM
Regarding the marco, any tips on how to do this, ive never really used macros much as I usually code everything



Part 1; Try recording a macro setting the required print area

Past 2; http://vbaexpress.com/kb/getarticle.php?kb_id=528

mdmackillop
01-16-2007, 04:02 PM
Click on Tools/Macros/Record New Macro
Carry out the actions to set the print area
Priint the worksheet
Stop Recording
You should have something like
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 16/01/2007 by Malcolm
'

'
Range("A1:J45").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$J$45"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("C11").Select
End Sub



Edit this to remove the verbiage
Sub PrintSelection()
ActiveSheet.PageSetup.PrintArea = "$A$1:$J$45"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub