vradhak7
08-10-2016, 09:33 AM
Hello EXPERTS,
I have this VBA code.
I need this code to automatically perform it in the next sheets. (Sheet2 and Sheet3) and copy the results after the last used row of the target sheet (Sheet 4). How do I add that piece to this existing code ? Thanks in advance!
Sub test()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("G" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If .Range("G" & i).Value = 1 Then .Rows(i).Copy Destination:=Sheets("Sheet4").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next i
End Sub
I have this VBA code.
I need this code to automatically perform it in the next sheets. (Sheet2 and Sheet3) and copy the results after the last used row of the target sheet (Sheet 4). How do I add that piece to this existing code ? Thanks in advance!
Sub test()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("G" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If .Range("G" & i).Value = 1 Then .Rows(i).Copy Destination:=Sheets("Sheet4").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next i
End Sub