imback2nite
Board Regular
- Joined
- Oct 30, 2004
- Messages
- 211
- Office Version
- 2003 or older
- Platform
- Windows
I'm hoping this is a stupid question. I use the code below to print a page. The problem is when I print to pdf, it comes out fine. Even when I print the pdf file. When I print to paper the print range I set is not used. The page prints twice the size in width. What am I doing wrong? Thank you in advance.
Rich (BB code):
Private Sub CommandButton4_Click()
Application.ScreenUpdating = False
YesNo = MsgBox("This Action Will Print, 'Tally Sheet' " & vbCr _
& " Continue?", vbYesNo + vbInformation, "Caution")
Select Case YesNo
Case vbYes
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$19"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$B$1:$N$319"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "&""Tahoma,Bold""CONFIDENTIAL"
.RightHeader = ""
.CenterFooter = "Page &P of &N"
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0#)
.RightMargin = Application.InchesToPoints(0#)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
.CenterHorizontally = True
.Orientation = xlPortrait
.Zoom = 52
.Draft = False
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("B1").Select
Application.ScreenUpdating = True
Case vbNo
Application.ScreenUpdating = False
Range("B1").Select
Application.ScreenUpdating = True
End Select
End Sub