+ Reply to Thread
Results 1 to 2 of 2

Print VBA problem

  1. #1
    Registered User
    Join Date
    07-19-2016
    Location
    Baton Rouge, Louisiana
    MS-Off Ver
    2016
    Posts
    41

    Print VBA problem

    Hello, first time poster here. I am using the following macro in order to print multiple sheets in one print job:
    PHP Code: 
    Sub Day32Print()
    '
    PrintSelectedNames Macro prints all selected athletes.
    '

    On Error GoTo ErrorHandler:
        
        Dim cell As Object
        For Each cell In Selection ' 
    each selected item
            
    'Dim i As Integer
            '
    1
            
    ' loop through weeks
            '
    Do While SheetExists("Week" "-" & (1))
                
    ' grab value from roster
            Range("X1").Value = cell.Value
            
                ' 
    print it
            ActiveSheet
    .PrintOut Copies:=1Preview:=False
                
                
    'i = i + 2
            '
    Loop
            
        Next cell
        
        
    Exit Sub
        
    ErrorHandler
    :
        
    MsgBox "Something wrong happened:" Err.Description
    End Sub

    Function SheetExists(SheetName As String) As Boolean
    ' returns TRUE if the sheet exists in the active workbook
        SheetExists = False
        On Error GoTo NoSuchSheet
        If Len(Sheets(SheetName).Name) > 0 Then
            SheetExists = True
            Exit Function
        End If
    NoSuchSheet:
    End Function 
    I am running into an issue where the print job doesn't go through. Where can I add in a line to get the sheet to print to the default printer?

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Print VBA problem

    http://stackoverflow.com/questions/7...from-excel-vba
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

+ 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. VBA to set print range, open box asking for print qty, print, then redefine print area
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2012, 06:43 PM
  2. VBA print problem
    By Aquila in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2010, 08:34 AM
  3. print problem
    By John Ploughman in forum Excel General
    Replies: 1
    Last Post: 09-24-2009, 01:47 PM
  4. Print problem
    By WhiteKelso in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2007, 01:34 PM
  5. Print or Print Area problem.
    By icetrey in forum Excel General
    Replies: 2
    Last Post: 03-19-2007, 02:35 AM
  6. Replies: 4
    Last Post: 02-17-2006, 08:36 AM
  7. Print problem..
    By proshail in forum Excel General
    Replies: 2
    Last Post: 07-04-2005, 06:05 PM
  8. [SOLVED] Print problem
    By RJH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2005, 11:05 PM

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