Hello, first time poster here. I am using the following macro in order to print multiple sheets in one print job:
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?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
'i = 1
' loop through weeks
'Do While SheetExists("Week" & i & "-" & (i + 1))
' grab value from roster
Range("X1").Value = cell.Value
' print it
ActiveSheet.PrintOut Copies:=1, Preview:=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
Bookmarks