I am using the following code for printing one row at a time. I was testing with 3 rows, 1st row is header.
When defined name _RecordNum = 2, it is printing ok. But for _RecordNum =3 it stops printing and gets out of the loop.
Why it is skipping this step.
Code:
Public Sub PrintAll()
Dim LastRow As Long
LastRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
Dim x As Integer
For x = 2 To LastRow
Range("_RecordNum") = x
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("_RecordNum").Value = Range("_RecordNum").Value + 1
x = x + 1
Next
End Sub
When defined name _RecordNum = 2, it is printing ok. But for _RecordNum =3 it stops printing and gets out of the loop.
Why it is skipping this step.