Results 1 to 5 of 5

VBA- Print Setting to Apply to Certain Sheets Not Working

Threaded View

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

    VBA- Print Setting to Apply to Certain Sheets Not Working

    Hi everyone:

    I'm trying to apply print settings and a few other format settings (row height, hide columns, etc) to only certain sheets in my workbook. However, when I run the code, it stays on the first tab (Summary tab) and applies the code but this is a sheet that I don't want to apply my settings to.

    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

    Any help will be appreciated!
    Last edited by egutierrez7; 03-23-2017 at 07:01 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA- Applying Print Settings to Certain Sheets is Not Working
    By egutierrez7 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 03-23-2017, 05:48 PM
  2. [SOLVED] Want to apply code to all sheets available in workbook except two sheets with fast working
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-28-2017, 08:55 AM
  3. Apply Worksheet Print Properties to all Sheets
    By Rico1919 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-09-2014, 09:59 PM
  4. automate setting the print area of a workbook having 57 sheets on a A4 size paper
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2013, 04:17 AM
  5. Setting Print Area across multiple sheets?
    By tekman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-21-2011, 10:40 PM
  6. 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
  7. 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

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