Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Grouping Print Jobs

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Grouping Print Jobs

Dave,
Thanks for your quick response - however, I think I wasn't clear about how
my charts are set up - I have 20 charts per sheet, and a total of 3
worksheets in a book. The table of contents page has 60 checkboxes that are
linked to each of the 60 charts. A user can choose to select any one or any
number of the 60 charts and then print them. What I need is a way to go to
the various pages on each of the 3 worksheets and only print those that have
been selected and print them in one print job. I'm not even sure if that's
possible. Since your answer selects the printing of an entire sheet, is
there a way to have it just selectively choose which pages it will print off
that sheet?

"Dave Peterson" wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Grouping Print Jobs

You could copy the charts and paste them as pictures.

Manually, if you select the chart, then shift-click on Edit, you'll see "Copy
Picture".

Then you could paste the picture into a new worksheet and stack them one below
the other.

I'm not sure how your dialog selects the charts, but maybe something like this
will give you an idea:

Option Explicit
Sub testme()
Dim ChtObj As ChartObject
Dim myTop As Double
Dim myPict As Picture
Dim prtWks As Worksheet

Set prtWks = Worksheets.Add

myTop = 0
For Each ChtObj In Worksheets("sheet1").ChartObjects
If Right(ChtObj.Name, 1) = "3" _
Or Right(ChtObj.Name, 1) = "5" Then
ChtObj.CopyPicture Appearance:=xlScreen, Format:=xlPicture
With prtWks
.Paste
Set myPict = .Pictures(.Pictures.Count)
myPict.Left = 0
myPict.Top = myTop
myPict.Width = ChtObj.Width
myPict.Height = ChtObj.Height
myTop = myTop + ChtObj.Height
End With
End If
Next ChtObj

End Sub

(I put a bunch of charts on a Sheet1 and then just wanted to copy then charts
that had names that ended with 3 or 5. (my way of testing just a partial set of
charts.)


SueDot wrote:

Dave,
Thanks for your quick response - however, I think I wasn't clear about how
my charts are set up - I have 20 charts per sheet, and a total of 3
worksheets in a book. The table of contents page has 60 checkboxes that are
linked to each of the 60 charts. A user can choose to select any one or any
number of the 60 charts and then print them. What I need is a way to go to
the various pages on each of the 3 worksheets and only print those that have
been selected and print them in one print job. I'm not even sure if that's
possible. Since your answer selects the printing of an entire sheet, is
there a way to have it just selectively choose which pages it will print off
that sheet?

"Dave Peterson" wrote:

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



--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Grouping Print Jobs

Sadly, I think I'm having too hard a time explaining my problem well enough
that someone unaquainted with it can figure out what I'm doing.
Unfortunately, the second approach you've outlined won't work for me, either.
After discussing it with others in my office, we've decided it just isn't
that big a deal to send 20 separate print jobs vs. one print job of 20 pages
so I'm going to leave the macros as they presently are. I can see you put a
lot of time and thought into your replies to me and I truly appreciate your
efforts. I'll keep them on file for future possibilities. Thanks so much
for trying!

"Dave Peterson" wrote:

You could copy the charts and paste them as pictures.

Manually, if you select the chart, then shift-click on Edit, you'll see "Copy
Picture".

Then you could paste the picture into a new worksheet and stack them one below
the other.

I'm not sure how your dialog selects the charts, but maybe something like this
will give you an idea:

Option Explicit
Sub testme()
Dim ChtObj As ChartObject
Dim myTop As Double
Dim myPict As Picture
Dim prtWks As Worksheet

Set prtWks = Worksheets.Add

myTop = 0
For Each ChtObj In Worksheets("sheet1").ChartObjects
If Right(ChtObj.Name, 1) = "3" _
Or Right(ChtObj.Name, 1) = "5" Then
ChtObj.CopyPicture Appearance:=xlScreen, Format:=xlPicture
With prtWks
.Paste
Set myPict = .Pictures(.Pictures.Count)
myPict.Left = 0
myPict.Top = myTop
myPict.Width = ChtObj.Width
myPict.Height = ChtObj.Height
myTop = myTop + ChtObj.Height
End With
End If
Next ChtObj

End Sub

(I put a bunch of charts on a Sheet1 and then just wanted to copy then charts
that had names that ended with 3 or 5. (my way of testing just a partial set of
charts.)


SueDot wrote:

Dave,
Thanks for your quick response - however, I think I wasn't clear about how
my charts are set up - I have 20 charts per sheet, and a total of 3
worksheets in a book. The table of contents page has 60 checkboxes that are
linked to each of the 60 charts. A user can choose to select any one or any
number of the 60 charts and then print them. What I need is a way to go to
the various pages on each of the 3 worksheets and only print those that have
been selected and print them in one print job. I'm not even sure if that's
possible. Since your answer selects the printing of an entire sheet, is
there a way to have it just selectively choose which pages it will print off
that sheet?

"Dave Peterson" wrote:

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



--

Dave Peterson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Print Jobs Together db Excel Discussion (Misc queries) 1 December 23rd 09 11:55 PM
Excel print jobs J Excel Discussion (Misc queries) 3 July 10th 08 07:18 PM
my excel is converting all my print jobs to print to file why? Ginger Excel Discussion (Misc queries) 2 April 10th 07 12:28 PM
single print job generates many print jobs Sherri Excel Discussion (Misc queries) 1 March 20th 07 09:34 PM
print jobs History of print jobs Excel Discussion (Misc queries) 3 June 16th 06 06:11 AM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"