I have a task list workbook with 2 sheets.
W1 is for open tasks and W2 is for closed tasks.
In W1,there is a column for "completed date" , that if i enter date on this column, the entire row should automatically transfer to W2.
I used this code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDest As Range
Set rngDest = sheet2.Range("rngDest")
' Limit the trap area to range of cells in which completed dates are entered as defined above
If Not Intersect(Target, Sheet1.Range("rngTrigger")) Is Nothing Then
' Only trigger if the value entred is a date or is recognizable as a valid date
If IsDate(Target) Then
'Ensure subsequent deletion of 'moved' row does NOT cause the Change Event to run again and get itself in a loop!
Application.EnableEvents = False
' Reset EnableEvents
Application.EnableEvents = True
But when I entered completed date in sheet 1, there is a prompt saying " error 1004, method range of object_worksheet failed".
How can I solve this? Thank you.