Hello All. I have a sheet called 'Log'. Row 1 contains the Titles which do not need to have the macro run on.
Cells A:I have the data.
I am trying to get the code to copy the row, Paste it to 'Print out'A1
Print the document the return to the log sheet and repeat the code on the next row until there is nothing left to copy. The below code is what i have so far although it doesnt seam to paste the values and it always prints the titles.
Any help would be very appreciated
Thankyou
Cells A:I have the data.
I am trying to get the code to copy the row, Paste it to 'Print out'A1
Print the document the return to the log sheet and repeat the code on the next row until there is nothing left to copy. The below code is what i have so far although it doesnt seam to paste the values and it always prints the titles.
Any help would be very appreciated
Thankyou
Code:
Sub PrintLogs()
Dim lastRow As Long, i As Long
Dim ws As Worksheet
Set ws = Sheets("Log")
lastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
With ws
For i = 1 To lastRow
If Len(Trim(.Range("A" & i).Value)) <> 0 Then _
.Range("J" & i).Formula = "Printed"
ActiveCell.EntireRow.Select
Selection.Copy
Sheets("Print-Out").Select
Range("A1").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Log").Select
Next i
End With
End Sub