Results 1 to 7 of 7

Print Scaling

Threaded View

gstroutz Print Scaling 10-26-2015, 05:37 PM
gstroutz Re: Print Scaling 10-26-2015, 06:00 PM
shg Re: Print Scaling 10-26-2015, 06:04 PM
gstroutz Re: Print Scaling 10-27-2015, 12:27 PM
shg Re: Print Scaling 10-27-2015, 12:52 PM
gstroutz Re: Print Scaling 10-27-2015, 01:10 PM
shg Re: Print Scaling 10-27-2015, 01:45 PM
  1. #1
    Registered User
    Join Date
    10-26-2015
    Location
    Southern California
    MS-Off Ver
    2010
    Posts
    4

    Print Scaling

    I am trying to print multiple pages on a single worksheet. Each page has the same number of row and a 65% scaling works fine in the interactive mode.
    After I run the following macro, the scaling is always reset to 10%, which I know is the minumum... just not sure why the worksheet isn't being scaled to 75%?
    any insight would be greatly appreciated.
    Sub testPrintScale ()
    
                    ActiveSheet.PageSetup.PrintArea = ActiveSheet.UsedRange.Address
                    With ActiveSheet.PageSetup
                        .Orientation = xlLandscape
                        .LeftMargin = Application.InchesToPoints(0.25)
                        .RightMargin = Application.InchesToPoints(0.2)
                        .TopMargin = Application.InchesToPoints(0.25)
                        .BottomMargin = Application.InchesToPoints(0.25)
                        .HeaderMargin = Application.InchesToPoints(0.3)
                        .FooterMargin = Application.InchesToPoints(0.3)
                        .Order = xlDownThenOver
                        .CenterHorizontally = True
                        .Zoom = 65
                    End With
                    
                      
                    ' Remove vertical page breaks
                    ActiveWindow.View = xlPageBreakPreview
                    ActiveSheet.ResetAllPageBreaks
                    For Each break In ActiveSheet.VPageBreaks
                        break.DragOff xlToRight, 1
                    Next break
                    
                   
                    firstLine = "my target string"
                    Set currentCell = ActiveSheet.Cells.Find(firstLine)
                    
                    If Not currentCell Is Nothing Then
                        firstAddress = currentCell.Address
                        Do
                            count = count + 1
                            ' Remove all Horizontal page break, so we can add our own
                            If count = 1 Then
                                If ActiveSheet.HPageBreaks.count > 0 Then
                                    ActiveSheet.HPageBreaks(1).DragOff Direction:=xlDown, RegionIndex:=1
                                End If
                            End If
                            
                            currentCell.Select                                                      ' Set target cell as ActiveCell
                            ActiveCell.Offset(0, (-currentCell.Column) + 1).Activate    ' Move ActiveCell column A of the current row
                                                   
                            If count >= 2 Then
                                 ActiveCell.Offset(-3, 0).Activate
                                 'Set ActiveSheet.HPageBreaks(count - 1).Location = ActiveCell
                                ActiveCell.PageBreak = xlPageBreakManual                            
                                count = count + 1
                                currentCell.Select
                               'Set ActiveSheet.HPageBreaks(count - 1).Location = ActiveCell
                                ActiveCell.PageBreak = xlPageBreakManual                            
                             End If
                                                   
                            Set currentCell = ActiveSheet.Cells.FindNext(currentCell)                        
                        Loop While Not currentCell Is Nothing And currentCell.Address <> firstAddress
                     End If  ' End if currentCell
                    
                            
        ActiveWindow.View = xlNormalView
        Range("A1").Select
    
    End Sub
    Last edited by gstroutz; 10-27-2015 at 01:08 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Get Print Scaling (Zoom) factor
    By RobGodfrey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2023, 01:30 PM
  2. Print two pages with two different scaling
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2015, 08:36 PM
  3. scaling userform to A4 Landscape and then print it.
    By rawtech in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2011, 03:43 AM
  4. Excel 2007 : Print scaling problem Excel 2007
    By stenageo in forum Excel General
    Replies: 1
    Last Post: 04-26-2010, 08:27 AM
  5. Excel 2007 : 2007 print scaling problem
    By Steve7 in forum Excel General
    Replies: 0
    Last Post: 01-18-2010, 01:42 PM
  6. how to print 2 columns on one sheet without scaling?
    By dandenson in forum Excel General
    Replies: 1
    Last Post: 01-19-2009, 05:08 PM
  7. [SOLVED] Spreadsheet will not print out legibly even after scaling
    By Troubled in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2005, 11:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1