Hi,
I am working on below to move a selection of rows in sheet x given the string "Dead" to a next sheet (sheet y) and subsequently insert the amount of rows selected in that next sheet. Can anyone give an example how to show this in the code?
Many thanks!
Sub Moverow()
Dim i As Long
For i = 2 To 100
If Worksheets("x").Range("B" & i) = "Dead" Then
Range(Range("B" & i), Range("B" & i).End(xlToRight)).Select
Selection.Copy
Worksheets("y").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown
End If
Next
End Sub
I am working on below to move a selection of rows in sheet x given the string "Dead" to a next sheet (sheet y) and subsequently insert the amount of rows selected in that next sheet. Can anyone give an example how to show this in the code?
Many thanks!
Sub Moverow()
Dim i As Long
For i = 2 To 100
If Worksheets("x").Range("B" & i) = "Dead" Then
Range(Range("B" & i), Range("B" & i).End(xlToRight)).Select
Selection.Copy
Worksheets("y").Select
Rows("2:2").Select
Selection.Insert Shift:=xlDown
End If
Next
End Sub
Last edited: