Auto Pagination for all types of printers

dctorrez

New Member
Joined
Sep 13, 2005
Messages
11
I have a document that I'm sharing use with my company and there several types of printers in the company. When I created the document everything printed fine on my printer. Now when another office wants to print and they have a different printer the pagination is off. Is there a command line I can insert that will auto adjust for different printer types ?
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
Code:
Is there a command line I can insert
No.

The difference is caused by the printer drivers on the various machines.

This might solve the problem. It forces the pages to reset when the workbook is opened. NB. There are 2 separate versions versions of the code here (or could be used together as shown). It goes into the ThisWorkBook code module.

Code:
Private Sub Workbook_Open()
    ' version for all sheets
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Worksheets
        ws.PageSetup.FitToPagesWide = 1
        ws.PageSetup.FitToPagesTall = 4
    Next
    '------------------------------------------------
    ' alternative for individual sheet
    With Worksheets(1)
        .PageSetup.FitToPagesWide = 1
        .PageSetup.FitToPagesTall = 2
    End With
End Sub
 

dctorrez

New Member
Joined
Sep 13, 2005
Messages
11
Printing a document on different printers

We tried the code but it appears to be still having problems. The problem is one office might have a HP 1200 and another might have a HP1400 and a third might have an Epson.

Do you think that code you provided might have solved my problem knowing this ?
 

dctorrez

New Member
Joined
Sep 13, 2005
Messages
11
We tried the code you provided but, it appears that it still is not setting the page brake up correctly. My issue is one office might have a HP1200 and the other a HP1400 then one might have a Epson 740. Do you think now knowing this the code should have corrected the problem?
 

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
As stated, the idea was to force the printer driver on the existing machine to work so it would change the settings according to the local requirement. I have never tried this because we all use HP printers here.

I assume you changed the numbers to suit your printout.

It may not have worked because you already have the settings. Try this code which changes to a single sheet and then back again (in theory :biggrin: )
Code:
    For Each ws In ThisWorkbook.Worksheets
        '- change to single page
        ws.PageSetup.FitToPagesWide = 1
        ws.PageSetup.FitToPagesTall = 1
        '- change to required setting
        ws.PageSetup.FitToPagesWide = 1
        ws.PageSetup.FitToPagesTall = 4
    Next

The only other thing I can think of is to put hard page breaks.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,111
Messages
5,570,257
Members
412,313
Latest member
pauloalex
Top