我想这样在Excel中列出我的可打印工作表:
Sl no Sheet name Printable sheet number Orientation Paper size
1. Sheet1 3 Landscape A4
2. Sheet2 2 Portrait lIgle
代码:
Sub printPages()
Dim r As Long
Dim s As Byte
r = 5
For s = 2 To ActiveWorkbook.Worksheets.Count
Cells(r, 2).Value = Worksheets(s).Name
Cells(r, 3).Value = Worksheets(s).PageSetup.Pages.Count
Cells(r, 4).Value = Worksheets(s).PageSetup.XlPageOrientation.Value
Cells(r, 5).Value = Worksheets(s).XlPaperSize.Name
r = r + 1
Next
End Sub
但是它不起作用。