Printing Problems

D

Dave

Hi Group,

Thanks for all your help I having an isuue printing. I am trying to
print all my worksheets in my spreadsheet, I am using the code below
to print it all, I got this code from the group or the web I am not
sure where,

Sub PrintAll()
' Macro to Print All Sheets
Dim CurVis As Long
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
With sh
CurVis = .Visible
.Visible = xlSheetVisible
.PrintOut
.Visible = CurVis
End With
Next sh
End Sub

This code prints the spreadsheets but not in the order that I want, I
want it to print in the order the sheets are laid out as below.

1 Profiles Research Check List
2 Waiver Fact Sheet
3 Related Entity 1
4 Related Entity 2
5 Related Entity 3
6 2-10000 Order and Cover
7 Under 2000 Order and Cover
8 Commission Conditional Ltr
9 Conditional under $2000
10 Conditional over $10000
11 Explain Ltr
12 PreWaiver Compliance Ltr
13 Bankruptcy Letter for Waivers
14 Ack Ltr for Waivers > 10000
15 Comm Denial Waiver Ltr 2K-10k
16 DiV Denial Waiver Ltr < 2K
17 EFT Rescind Ltr
18 Div Deny No Balance Ltr
19 Waiver Hearing Ltr TP to Appear
20 Rescind Ltr
21 Partial Rel Waivers Order Ltr
22 Misc Ltr


Additionally the spreadsheet Waiver Fact Sheet prints some time and
some times it does not. Its a pretty big spreadsheet may be I need to
put a time out or something on it to give it more time to spool.

All guidance is good guidance.

Thanks for all your help,

Dave
 
M

Matthew Herbert

Hi Group,

Thanks for all your help  I having an isuue printing. I am trying to
print all my worksheets in my spreadsheet, I am using the code below
to print it all, I got this code from the group  or the web  I am not
sure where,

Sub PrintAll()
' Macro to Print All Sheets
    Dim CurVis As Long
    Dim sh As Worksheet
    For Each sh In ActiveWorkbook.Worksheets
        With sh
            CurVis = .Visible
            .Visible = xlSheetVisible
            .PrintOut
            .Visible = CurVis
        End With
    Next sh
End Sub

This code prints the spreadsheets but not in the order that  I want, I
want it to print in the order the sheets are laid out as below.

1        Profiles Research Check List
2        Waiver Fact Sheet
3        Related Entity 1
4        Related Entity 2
5        Related Entity 3
6        2-10000 Order and Cover
7        Under 2000 Order and Cover
8        Commission Conditional Ltr
9        Conditional under  $2000
10       Conditional over  $10000
11       Explain Ltr
12       PreWaiver Compliance Ltr
13       Bankruptcy Letter for Waivers
14       Ack Ltr for Waivers > 10000
15       Comm Denial Waiver Ltr 2K-10k
16       DiV Denial Waiver Ltr < 2K
17       EFT Rescind Ltr
18       Div Deny No Balance Ltr
19       Waiver Hearing Ltr TP to Appear
20        Rescind Ltr
21       Partial Rel Waivers Order Ltr
22       Misc Ltr

Additionally the spreadsheet Waiver Fact Sheet prints some time and
some times it does not. Its a pretty big spreadsheet may be I need to
put a time out or something on it to give it more time to spool.

All guidance is good guidance.

Thanks for all your help,

Dave

Dave,

Your worksheets have a code name and a sheet name. It's likely that
the For Each loop is looping through the code name sort order rather
than your visible sheet name order, albeit that all sheets are
printed. If you want a specific order, then you can try a For loop
(For intI = 1 to Worksheets.Count) instead. Otherwise, you may need
to create an array with the exact order and then loop through the
array (e.g. varArr = Array("Profiles Research Check List", "Waiver
Fact Sheet", etc.) or varArr = Array(1, 2, 5, etc.)).

I'm not sure about the page that prints only part of the time. You
can try pausing the program in between sending print jobs (e.g.
Application.Wait Now + TimeSerial(0, 0, 1)) to determine if that
helps.

Best,

Matthew Herbert
 

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

Top