如何打印Excel表格的列表

我在工作簿中列出一张表格的索引,然后打印一些列表(列A中的列表,列B中的标记,我想列印的列表)

你有一些代码,在VBA Excel?

我会非常感谢

Sub PrintSheets() Dim cell As Range For Each cell In Sheet1.Range("A1:A10") '''(change this) If cell.Offset(0, 1).Value <> "" Then Sheets(cell.Value).PrintOut End If Next cell End Sub 

如何使用工作表属性来select要打印的工作表。

像标签颜色 – 易于设置和一个很好的视觉指标。

  Sub PrintSheets() Dim sb As String sb = Application.StatusBar If sb = "False" Then sb = "" Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If 0 < ws.Tab.ColorIndex Then Application.StatusBar = "Printing " & ws.Name & " ..." ws.PrintOut End If Next Application.StatusBar = sb End Sub