Hi Guys,
Have the following line of code that I would like to add 1 to the result of.
Cells(Target.Row, "F") = Cells(Target.Row, "E") - Cells(Target.Row, "D")
I've tried a number of ways to get this to work with no luck. Any thought's would be great.
It forms part of the following code that I have, just FYI
--------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("D16:D100", "E16:E100")) Is Nothing Then
Call DateCheck
End If
If IsEmpty(Cells(Target.Row, "D")) = False And IsEmpty(Cells(Target.Row, "E")) = False Then
'If Cells(Target.Row, "E") > Cells(Target.Row, "D") Then
Cells(Target.Row, "F") = Cells(Target.Row, "E") - Cells(Target.Row, "D")
End If
'End If
End Sub
---------------------------------------------
*note: I've taken out the chk to determine if the EndDate is earlier than the StartDate (i.e. negative number), as this didn't seem to work.
Have the following line of code that I would like to add 1 to the result of.
Cells(Target.Row, "F") = Cells(Target.Row, "E") - Cells(Target.Row, "D")
I've tried a number of ways to get this to work with no luck. Any thought's would be great.
It forms part of the following code that I have, just FYI
--------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Not Application.Intersect(Target, Range("D16:D100", "E16:E100")) Is Nothing Then
Call DateCheck
End If
If IsEmpty(Cells(Target.Row, "D")) = False And IsEmpty(Cells(Target.Row, "E")) = False Then
'If Cells(Target.Row, "E") > Cells(Target.Row, "D") Then
Cells(Target.Row, "F") = Cells(Target.Row, "E") - Cells(Target.Row, "D")
End If
'End If
End Sub
---------------------------------------------
*note: I've taken out the chk to determine if the EndDate is earlier than the StartDate (i.e. negative number), as this didn't seem to work.