Hello
I was wondering how to move a row if Y or y was entered in column L. The row will deleted from sheet1 and moved to sheet2.
I would like this code to run when ever there is a change I believe the code is Sub Workbook_Change or something, but I never got anything to work.
Here is a link to the file if that helps. Row L would be the column to be looking for a Y or y. Not sure if this maters, but Row L is set to hidden (so it wont print off) I did this under format cells - protection - then the check box for hidden. As well the top 4 lines are Locked so needs to start on the 5th line.
http://www.filedropper.com/prioritylisttest
Thank-you for the help in advance
So far i did this but it doesnt work for me and does not only look for Y or y.
Private Sub Workbook_Change()
If Not Intersect(Target, Range("L")) Is Nothing Then
Set sh1 = Sheets(1)
Set sh2 = Sheets(2)
LR1 = sh1.Cells(Rows.Count, "B").End(xlUp).Row
drow = 5
For j = 5 To LR1
If sh1.Range("L" & j) <> "" Then
sh1.Rows(j).Copy sh2.Range("A" & drow)
sh1.Rows(j).Delete
j = j - 1
drow = drow + 1
End If
Next
End Sub
I was wondering how to move a row if Y or y was entered in column L. The row will deleted from sheet1 and moved to sheet2.
I would like this code to run when ever there is a change I believe the code is Sub Workbook_Change or something, but I never got anything to work.
Here is a link to the file if that helps. Row L would be the column to be looking for a Y or y. Not sure if this maters, but Row L is set to hidden (so it wont print off) I did this under format cells - protection - then the check box for hidden. As well the top 4 lines are Locked so needs to start on the 5th line.
http://www.filedropper.com/prioritylisttest
Thank-you for the help in advance
So far i did this but it doesnt work for me and does not only look for Y or y.
Private Sub Workbook_Change()
If Not Intersect(Target, Range("L")) Is Nothing Then
Set sh1 = Sheets(1)
Set sh2 = Sheets(2)
LR1 = sh1.Cells(Rows.Count, "B").End(xlUp).Row
drow = 5
For j = 5 To LR1
If sh1.Range("L" & j) <> "" Then
sh1.Rows(j).Copy sh2.Range("A" & drow)
sh1.Rows(j).Delete
j = j - 1
drow = drow + 1
End If
Next
End Sub