Hi, I have a VBA in my spreadsheet
As you can see this moves a record to a different tab if, for example they choose deceased. I was wondering if there was a way to do the same thing if they type a date in the AD column.
Thanks in advance
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Intersect(Target, Range("AD:AD")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
If Target.Value = "Deceased" Then
Target.EntireRow.Copy Worksheets("Deceased").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "Stopped Funding" Then
Target.EntireRow.Copy Worksheets("No Longer Funded").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "Change of Care Package" Then
Target.EntireRow.Copy Worksheets("Change of Care Package").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
End If
endit:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
As you can see this moves a record to a different tab if, for example they choose deceased. I was wondering if there was a way to do the same thing if they type a date in the AD column.
Thanks in advance
Last edited by a moderator: