Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code in my program to allow printing of the
database (size changes frequently). Public Sub PrintData() Dim lrow As Range Dim rc As Integer Dim ar As Integer Dim Response As String Sheets(1).Activate Set lrow = Sheet1.Range("A" & Rows.Count).End(xlUp) ' lrow.Activate 'ar = ActiveCell.row ' 'Range(Cells(1, "a"), Cells(ar, "M")).Select ' Selects Print Area ' ' MsgBox ("Ensure that the Printer is on!") ActiveSheet.PageSetup.PrintArea = _ ActiveCell.CurrentRegion.Address With ActiveSheet.PageSetup .PrintTitleRows = "$1:$4" .PrintTitleColumns = "" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(0.5) .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperLegal .FirstPageNumber = xlAutomatic .Order = xlDownThenOver Response = MsgBox("Print in Black and White?", vbYesNo) If Response = vbYes Then .BlackAndWhite = True Else .BlackAndWhite = False End If .Zoom = 100 End With ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Range("A5").Select Application.ScreenUpdating = True End Sub This works beautifully but only prints the entire database, however there are times that I may only want certain pages to be printed. Any suggestions on how to do this? Dooley |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
My excel spreadsheet won't print or print preview all the pages? | Excel Worksheet Functions | |||
Number of pages in worksheet doesn't match Print Preview pages | Excel Discussion (Misc queries) | |||
how do i print pages of pages example (1of3) | Excel Discussion (Misc queries) | |||
How to print odd pages and even pages seperately in Excel. | Excel Discussion (Misc queries) | |||
Can I print only specified pages from a print range such as pages 1,3,4,6 | Excel Programming |