Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook

  • Thread starter Thread starter will
  • Start date Start date
W

will

I thought that this would do it but it is giving me an error of:
1004 Methough PrintOut of object Sheets failed

Sub PrintMacro()
vCopies = InputBox("How Many Copies?")
i = 1
For i = 1 To vCopies
Sheets.PrintOut
Next i
End Sub

Any help is appreciated
Thanks
 
Hi Will

Try this

Sub Print_Visible_sheets()
'xlSheetVisible = -1
Dim sh
Dim arr() As String
Dim N As Integer
N = 0
For Each sh In ThisWorkbook.Sheets
If sh.Visible = -1 Then
N = N + 1
ReDim Preserve arr(1 To N)
arr(N) = sh.Name
End If
Next
ThisWorkbook.Sheets(arr).PrintOut
Sheets(1).Select
End Sub


More info here
http://www.rondebruin.nl/print.htm#visible
 
No luck with this working. The problem is that arr(N) is not getting
the actual name of the worksheet it is just putting in "Sheet1"
"Sheet2" "Sheet3" etc...
Whereas the names of my sheets are "Data" "XYZ" "YTD" etc...

Thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top