+ Reply to Thread
Results 1 to 10 of 10

VBA for print if cell contains, then choose printer. Have code just need advice.

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2013
    Posts
    177

    Re: VBA for print if cell contains, then choose printer. Have code just need advice.

    Quote Originally Posted by JBeaucaire View Post
    I fear you are not reading these macros carefully and absorbing what they are doing and when/how.
    Fair comment!

    I tried:
    Sub PrintSheetsJbeau()
        
        Dim i               As Long
        Dim sSheetNames()   As String
        Dim ws              As Worksheet
    
        Application.Dialogs(xlDialogPrinterSetup).Show
      For Each ws In ActiveWorkbook.Worksheets
               If UCase(ws.Range("E1")) = "YES" Then
                ws.PageSetup.CenterHeader = ws.Range("A2").Value
                    Sheets(sSheetNames).Select
    
                ws.PrintOut
            End If
    
        Next ws
    
    End Sub
    I am still very new to VB (one week!), I'm stuggling to identify what line of code in vfxd's groups it into one print job?
    Last edited by JBeaucaire; 08-10-2012 at 08:40 PM. Reason: removed duplicate post info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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