Help!

printing cell selection script


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Printing RSS
Next:  help with an auto copy functon  
Author Message
951lwebb



Joined: Nov 20, 2007
Posts: 4



PostPosted: Wed Nov 21, 2007 3:11 pm    Post subject: printing cell selection script

please can somebody help me with a script that will print a certain cell selection that i can add to a button.

thank you
Back to top
PeekabooCanada



Joined: Jun 14, 2006
Posts: 8



PostPosted: Thu Nov 22, 2007 7:58 am    Post subject:

Public Sub MySetPrintArea()
'
'
' to set the print area from cell A1 to cell D25
' adjust accordingly
'
'

With ActiveSheet
.PageSetup.PrintArea = "A1:D25"
End With

End Sub
Back to top
951lwebb



Joined: Nov 20, 2007
Posts: 4



PostPosted: Thu Nov 22, 2007 9:38 am    Post subject:

this has not worked, it is not sending anything to the printer queue?
Back to top
PeekabooCanada



Joined: Jun 14, 2006
Posts: 8



PostPosted: Thu Nov 22, 2007 10:57 am    Post subject:

'try this

Sub MySetPrintArea()
'
'
' to set the print area from cell A1 to cell D25
' adjust accordingly
'
'

With ActiveSheet
.PageSetup.PrintArea = "A1:D25"
End With


' to print assuming the default printer is the one you want to print from
' copies and collate may change depending on your printer
' they can be saftly removed is you don't need them
'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True


End Sub
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Printing All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum