0
我有一個非常具體的電子表格,其中包含所有員工的工資/獎金。每位員工都有4行(薪金/獎金/薪金%增值/獎金佔工資的百分比)。我遇到的問題是,如果一些管理人員將其員工切換到多個頁面,所以我將其切換爲適合1 x 1,但現在顯然它過於精簡。有沒有辦法讓宏組以4行的形式打印?或者可以這樣做,它爲同一頁面上的每個員工打印4行(薪水/獎金/工資%工資的百分比/獎金)預先感謝您!VBA 4行打印
Private Sub CommandButton1_Click()
Dim Sel_Manager As String
'Specify headers to be repeated at the top
With ActiveSheet.PageSetup
.PrintTitleRows = "$5:$10"
.PrintTitleColumns = "$B:$M"
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
'Manager selection through simple Inputbox
Sel_Manager = ComboBox1
'Insert autofilter for worksheet
Cells.Select
Selection.AutoFilter
'Select manager defined in inputbox
ActiveSheet.Range("B10", Range("M10").End(xlDown)).AutoFilter Field:=1, Criteria1:=Sel_Manager
'Select range to be printed and specify manager in filename
ActiveSheet.Range("B10", Range("M10").End(xlDown)).Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Sel_Manager + ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
ActiveSheet.ShowAllData
End Sub