poz samo promjeni u kodu raspon print area
evo kod
ALT+F11
mjenjaš samo raspon ćelija u ovom slučaju D17:D24
komand button ti i ne treba samo odeš na print preview
Private Sub CommandButton1_Click()
ActiveSheet.PageSetup.PrintArea = Range("D17:d24").CurrentRegion.Address 'ovdje mjenaš raspon ako koristiš print area
ActiveSheet.PrintPreview
End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
On Error Resume Next
.PrintArea = "D17:D24" 'ovdje mjenjaš raspon
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.375)
.FooterMargin = Application.InchesToPoints(0.375)
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
'.PaperSize = xlPaperFanfoldUS 'U.S. Standard Fanfold (14-7/8 in. x 11 in.)
.PaperSize = xlPaper10x14
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub
Jasmin