Hi,
I have this code that a few of you have helped me with a few weeks ago and it works good except one small thing.
The idea was to move an entire row based on a date (any) that is put in the same row in column "I" (starting at row 8), which doesn't work at this time either (it takes any row even above 8 if anything is entered into that rows "I column" but that's ok I locked everyone out of 1-7 for the headers).
The way it is now if anything goes in the cell it moves the row, which is ok (not ideal, I would like it to only move if its a date) but if any letter or anything is in there it moves. The biggest issue is that if someone starts typing something in that cell and they realize they clicked in the wrong row/date cell and try to backspace or delete the date, no matter what they do it still shoots the row to the next page. Even if they backspace and click another cell, that cell is gone. Any way to prevent this based on what is below?
Thanks, and if it could be a "date only" trigger that would be fantastic, I'm just not sure how to work that into the code.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim nextrow As Long, i As Long
nextrow = Sheet10.Cells(Rows.Count, "I").End(xlUp).Row + 1
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
If Not Intersect(Target, Range("I8:I" & Cells(Rows.Count, "I").End(xlUp).Row)) Is Nothing Then
i = Target.Row
If Target.NumberFormat > 1 Then
Range(Cells(i, "A"), Cells(i, "O")).Copy
Sheet10.Range("A" & nextrow).PasteSpecial xlPasteValues
Application.EnableEvents = False
Range("A" & Target.Row).EntireRow.Delete
Application.EnableEvents = True
Range("I" & i).Select
End If
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Bookmarks