In ấn

Liên hệ QC

khamphaexcel

Thành viên mới
Tham gia
28/11/06
Bài viết
3
Được thích
0
làm sao mà có thể in nhiều trang EXcel theo mirror?
Có một tài liệu .pdf làm sao em có thể in 2 page per A4 or mirror?
giup em voi!
 
làm sao mà có thể in nhiều trang EXcel theo mirror?
Bạn thử dùng code này xem sao:
Mã:
Option Explicit
Public Sub Print_Mirror()
On Error GoTo end_macro
Dim Left_margin, Right_margin
Dim page_i As Integer
Dim page_start As Integer, page_end As Integer
page_start = CInt(InputBox("Ban in tu trang thu: ", , 1))
page_end = CInt(InputBox("den trang thu: ", , 3))
Dim scale_1
With Application.DefaultWebOptions
    Select Case .ScreenSize
        Case msoScreenSize800x600
            scale_1 = 72
        Case msoScreenSize1024x768
            scale_1 = 96
        Case Else
            scale_1 = 120
    End Select
End With
Left_margin = ActiveSheet.PageSetup.LeftMargin / scale_1
Right_margin = ActiveSheet.PageSetup.RightMargin / scale_1
For page_i = page_start To page_end
    If page_i Mod 2 = 1 Then ' trang le
        ActiveSheet.PageSetup.LeftMargin = Application.InchesToPoints(Left_margin)
        ActiveSheet.PageSetup.RightMargin = Application.InchesToPoints(Right_margin)
        'ActiveWindow.SelectedSheets.PrintPreview
        ActiveWindow.SelectedSheets.PrintOut From:=page_i, to:=page_i, Copies:=1, Collate:=True
    Else 'trang chan
        ActiveSheet.PageSetup.LeftMargin = Application.InchesToPoints(Right_margin)
        ActiveSheet.PageSetup.RightMargin = Application.InchesToPoints(Left_margin)
        'ActiveWindow.SelectedSheets.PrintPreview
        ActiveWindow.SelectedSheets.PrintOut From:=page_i, to:=page_i, Copies:=1, Collate:=True
    End If
Next page_i
end_macro:
'Tra ve mac dinh truoc khi in
ActiveSheet.PageSetup.LeftMargin = Application.InchesToPoints(Left_margin)
ActiveSheet.PageSetup.RightMargin = Application.InchesToPoints(Right_margin)
End Sub
 
Upvote 0
Web KT
Back
Top Bottom