ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   button to print (https://www.excelbanter.com/new-users-excel/4858-button-print.html)

rob

button to print
 
Hi I have got a big worksheet with lots of information in
it. I need to have a button to be able to click and
print a sheet out automatically - Is this possible?

If you do know a way to do this please let me know.

Thank you

Rob

Gord Dibben

rob

It is possible, but only you know what you want printed and what your print
setup(printarea, margins, headers/footers etc.) will be.

Suggest you Turn on the macro recorder while you do all that then print the
sheet.

You will get something like this...........

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 1/13/2005 by Gord Dibben


ActiveSheet.PageSetup.PrintArea = "$A$1:$N$32"
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$32"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P of &N"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.551181102362205)
.RightMargin = Application.InchesToPoints(0.275590551181102)
.TopMargin = Application.InchesToPoints(0.748031496062992)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

Enable the Forms Toolbar and draw a button on the sheet. Assign the macro to
the button.


Gord Dibben Excel MVP

On Thu, 13 Jan 2005 13:04:27 -0800, "rob"
wrote:

Hi I have got a big worksheet with lots of information in
it. I need to have a button to be able to click and
print a sheet out automatically - Is this possible?

If you do know a way to do this please let me know.

Thank you

Rob



Don Guillett

If your toolbar does NOT have a printer icon on it already then
right click the toolbarcustomizecommandsfileprint icon(drag to
toolbar)OK

--
Don Guillett
SalesAid Software

"rob" wrote in message
...
Hi I have got a big worksheet with lots of information in
it. I need to have a button to be able to click and
print a sheet out automatically - Is this possible?

If you do know a way to do this please let me know.

Thank you

Rob





All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com