Hi I have a spreadsheet with a VBA code to automatically move the line to a different tab when something is selected from a dropdown list.
I now want to ensure that all the cells on that line have a value in them before the above code will let them move the line, and if not it will highlight the ones that need completing (though this part isn't as important). Thanks is 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 = "Discharged after LTC input" Then
Target.EntireRow.Copy Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "Deceased" Then
Target.EntireRow.Copy Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "D2A" Then
Target.EntireRow.Copy Worksheets("D2A").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "Fast Track" Then
Target.EntireRow.Copy Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "Residential" Then
Target.EntireRow.Copy Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target.Value = "No LTC input" Then
Target.EntireRow.Copy Worksheets("Inactive").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
End If
endit:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
I now want to ensure that all the cells on that line have a value in them before the above code will let them move the line, and if not it will highlight the ones that need completing (though this part isn't as important). Thanks is advance