View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Grouping Print Jobs

If you can build an array of those sheetnames, you can print that as a group.

Try selecting a few sheets (click on the first and ctrl-click on subsequent).

Then print that test.

If that prints as one job, maybe you build that array of names in code:

Option Explicit
Sub testme()

Dim mySheetNames() As String
Dim iCtr As Long
Dim wCtr As Long

iCtr = 0
For wCtr = 1 To Sheets.Count
If wCtr Mod 2 = 0 Then
iCtr = iCtr + 1
ReDim Preserve mySheetNames(1 To iCtr)
mySheetNames(iCtr) = Sheets(wCtr).Name
End If
Next wCtr

If iCtr = 0 Then
'do nothing
Else
Sheets(mySheetNames).PrintOut preview:=True
End If

End Sub

This example just looked for even numbered worksheets. But you could loop
through your checkboxes and build that array.





SueDot wrote:

Hi -
I have multiple workbooks containing 60 printable graph pages each. In the
front of each workbook I have a "table of contents" worksheet where a user
can click a check box for whichever of the 60 graphs they need to print at a
given time. This works great except that the way I've written the macro,
each selection goes to the printer individually. Is there a way to group the
numerous selections a user may have checked and send them to the printer as
just one print job? Here's an example of the working macro as currently
written--

Print Graphs Macro:

Dim Copies As Integer

Dim TOC As String, R12G As String, PVCG As String, M36G As String
TOC = "Table of Contents"
R12G = "Rolling 12 Graphs"
PVCG = "Premium_vs_Claims_Graphs"
M36G = "Monthly_36_Graphs"

If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub

Application.ScreenUpdating = False

With Sheets(TOC)
Copies = .CopyCount.Value
If .P1RT.Value = True Then
Sheets(R12G).Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1,
Copies:=Copies, Collate:=True
End If
If .P1PC.Value = True Then
Sheets(PVCG).Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1,
Copies:=Copies, Collate:=True
End If

Note: The "P1RT" and "P1PC" represent names given to the check boxes. I
have 60 checkboxes and am only showing the commands for two of them here, to
save space.

Thanks in advance for any ideas!
Susan


--

Dave Peterson