+ Reply to Thread
Results 1 to 2 of 2

VBA- Applying Print Settings to Certain Sheets is Not Working

  1. #1
    Registered User
    Join Date
    03-23-2017
    Location
    Texas, United States
    MS-Off Ver
    MS Office Professional Plus 2010
    Posts
    3

    VBA- Applying Print Settings to Certain Sheets is Not Working

    Hi everyone! I'm trying to apply print settings to certain sheets in a workbook (all but the 2 listed in the code below -Summary and ARO tabs). When I run the code, it stays on the first tab (Summary) and applies the hide columns command which this should only be applied to the sheets I'm setting the print areas.

    Sub FormatSheets()

    Dim ws As Worksheet

    ws.Activate
    For Each ws In ActiveWorkbook.Worksheets
    Select Case ws.Name
    Case "Summary", "ARO"
    Case Else

    With ws.PageSetup

    .PrintTitleRows = "$1:$1"
    .Orientation = xlLandscape
    .Zoom = False
    .FitToPagesWide = 1
    .FitToPagesTall = False
    .LeftMargin = Application.InchesToPoints(0.25)
    .RightMargin = Application.InchesToPoints(0.25)
    .TopMargin = Application.InchesToPoints(0.75)
    .BottomMargin = Application.InchesToPoints(0.75)
    .HeaderMargin = Application.InchesToPoints(0.3)
    .FooterMargin = Application.InchesToPoints(0.3)

    End With
    ws.Cells.Select
    Selection.WrapText = True
    Selection.ColumnWidth = 10
    Selection.EntireRow.AutoFit
    Range("A:A,U:U,W:W,Y:Y,Z:Z,AE:AE,AG:AG,AI:AI,AJ:AJ,AP:AP").EntireColumn.Hidden = True


    End Select
    Next ws

    End Sub


    I'd appreciate any help!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello egutierrez7,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to print pdf with certain print settings
    By ChrisLN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2016, 07:44 AM
  2. macro to copy all print settings to all sheets
    By rbanks in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2016, 11:13 AM
  3. Default Settings in Backstage Print to "Print Selection
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2014, 06:12 PM
  4. Apply Print Settings to Multiple Sheets via MACRO
    By ShaneBell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2009, 08:48 PM
  5. Print Settings
    By bud144 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-28-2006, 06:12 AM
  6. How do I apply the same print settings to all sheets in a workbk
    By Excel Print Entire Workbook Settings in forum Excel General
    Replies: 0
    Last Post: 09-15-2005, 10:05 AM
  7. Applying Print Settings to Several Spreadsheets At Once
    By JR_06062005 in forum Excel General
    Replies: 1
    Last Post: 08-03-2005, 11:05 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