R
rduke0
After working with the user to limit the number of sheets displayed in a
workbook (that includes 97 sheets) I would like to offer them the
ability to print those sheets that are visible.
Here is the code I have. It does select the sheets but I cannot print
them. I have tried the printout syntax a million different ways but
can't seem to get it to work.
Sub Print_ActiveSheets_Macro()
Sheets("Control").Select
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Visible Then ws.Select False
Next ws
msg = "You are printing the sheets selected below. " & vbCrLf
msg = msg & "Do you want to continue?"
response = MsgBox(msg, vbOKCancel + vbQuestion, "Print Alert")
If response = vbOK Then ws.PrintOut
' For Each Worksheet In ws
End Sub
Thanks for your help
workbook (that includes 97 sheets) I would like to offer them the
ability to print those sheets that are visible.
Here is the code I have. It does select the sheets but I cannot print
them. I have tried the printout syntax a million different ways but
can't seem to get it to work.
Sub Print_ActiveSheets_Macro()
Sheets("Control").Select
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Visible Then ws.Select False
Next ws
msg = "You are printing the sheets selected below. " & vbCrLf
msg = msg & "Do you want to continue?"
response = MsgBox(msg, vbOKCancel + vbQuestion, "Print Alert")
If response = vbOK Then ws.PrintOut
' For Each Worksheet In ws
End Sub
Thanks for your help