Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Resizing A4 worksheets for printing (2000 sr 1)

    ... is possible to set for every wbook loaded the size of printng in A4 standard?

    For example i have loaded a wbook from an USA site and when i print this from the little print icon in a bar of my excel the print go in error "insert Dl letter"...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Resizing A4 worksheets for printing (2000 sr 1)

    I don't think you can set this as standard, since the paper size is stored with each worksheet.

    You can create a simple macro that will set paper size to A4. If you store it in your personal macro workbook, you can assign the macro to a custom toolbar button, so that you can set all sheets in a workbook to A4 with one mouse click.

    Here is the macro:

    Sub SetA4()
    Dim i As Integer
    For i = 1 To ActiveWorkbook.Sheets.Count
    ActiveWorkbook.Sheets(i).PageSetup.PaperSize = xlPaperA4
    Next i
    End Sub

    For information about the personal macro workbook, see <!post=Personal.xls Tutorial (All),118382>Personal.xls Tutorial (All)<!/post>.

    Note: the above macro will fail if there are protected worksheets.

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Resizing A4 worksheets for printing (2000 sr 1

    Changing the paper size in a Workbook takes longer than one might think. The following code changes only the worksheets that are not already set to A4. It also saves the Workbook when you have changed the paper size. Finally, you can use it for changing sheets back to Letter size if you have to send the file back to the US. <pre>Sub PaperSize() 'flips paper size between A4 and Letter
    Dim w As Integer
    Dim bytChoice As Byte
    'Test for setting - based on first sheet
    Select Case ActiveWorkbook.Worksheets(1).PageSetup.PaperSize
    Case xlPaperA4 'Change to Letter
    bytChoice = MsgBox("Changing " & ActiveWorkbook.Worksheets.Count & " worksheets to & _
    Letter." vbLf & "Do you want to proceed?", vbOKCancel)
    Case xlPaperLetter 'Change to A4
    bytChoice = MsgBox("Changing " & ActiveWorkbook.Worksheets.Count & " worksheets to & _
    A4." vbLf & "Do you want to proceed?", vbOKCancel)
    Case Else 'In case of strange format, quit explaining why
    MsgBox "The paper size is neither A4 nor Letter." & _
    vbLf & "Not possible to proceed."
    Exit Sub
    End Select
    If bytChoice = 2 Then 'Quit on Cancel
    Exit Sub
    Else: Application.Cursor = xlWait 'Otherwise show the user something is happening
    End If
    'Test for setting - based on first sheet
    Select Case ActiveWorkbook.Worksheets(1).PageSetup.PaperSize
    Case xlPaperA4 'Change to Letter
    'Loop through the workbook and change as appropriate
    For w = 1 To ActiveWorkbook.Worksheets.Count
    If Worksheets(w).PageSetup.PaperSize = xlPaperA4 Then
    Worksheets(w).PageSetup.PaperSize = xlPaperLetter
    End If
    Next w
    Case xlPaperLetter 'Change to A4
    'Loop through the workbook and change as appropriate
    For w = 1 To ActiveWorkbook.Worksheets.Count
    If Worksheets(w).PageSetup.PaperSize = xlPaperLetter Then
    Worksheets(w).PageSetup.PaperSize = xlPaperA4
    End If
    Next w
    End Select
    ActiveWorkbook.Save 'Save the workbook
    Application.Cursor = xlDefault 'Change the cursor back to normal
    End Sub</pre>

    HTH
    Gre

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Resizing A4 worksheets for printing (2000 sr 1

    BIG reply, BIG help!
    Tks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •