Sub PrintPreviewVisibleSheets()
Dim arrSheets() As String
Dim i As Integer
Dim sht As Object
'' Print preview for all visible sheets
For Each sht In ActiveWorkbook.Sheets
If sht.Visible < 0 Then
ReDim Preserve arrSheets(i)
arrSheets(i) = sht.Name
i = i + 1
End If
Next
ActiveWorkbook.Sheets(arrSheets).PrintOut preview:=True
End Sub
No comments:
Post a Comment