marreco
Well-known Member
- Joined
- Jan 1, 2011
- Messages
- 609
- Office Version
- 2010
- Platform
- Windows
Hi.
a friend called arlu1201 help me make this macro.
When you run the macro, it would copy the selected rows to the worksheet "Result_Print" as doing this, and it would trigger the printing of the first row, exclude the first line,
By excluding the first-line second would be the first shot and then a new print and so on to print all lines.
Thank you!!!
a friend called arlu1201 help me make this macro.
When you run the macro, it would copy the selected rows to the worksheet "Result_Print" as doing this, and it would trigger the printing of the first row, exclude the first line,
By excluding the first-line second would be the first shot and then a new print and so on to print all lines.
Code:
Option Explicit
Sub copy_print()
Dim i As Long, lrow As Long
With Worksheets("Base")
lrow = .Range("B" & .Rows.Count).End(xlUp).Row
For i = 2 To lrow
If .Range("A" & i).Value = "x" Then
.Range("B" & i & ":F" & i).Copy Worksheets("Result_Print").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next i
End With
End Sub