@
@Homeonthecouch
Hello,
I have a sheet that I am entering data into cells B:B
I have an event macro set up to auto time and date in adjacent cells A:A
I would like C:C to calculate the difference between cell b5-b4, b6-b5,
b7-b6 etc. etc.
=IF(ISBLANK(B3),"",B3-B2)
The results in C:C will be both + and - values.
I want to run a condition that will colour the cells defined by either plus
or minus values with the code below.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("b:b")) Is Nothing Then Exit Sub
Select Case Target.Column
Case Is = Me.Range("b1").Column
With Target
If .Row = 1 Then
'do nothing
Else
If IsEmpty(.Cells) Then
'do nothing
Else
'don't fire again!
Application.EnableEvents = False
With .Offset(0, -1)
.NumberFormat = "dddd - dd mmmm yyyy - hh:mm:ss"
.Value = Now
End With
Application.EnableEvents = True
End If
End If
End With
End Select
End Sub
Any help is appreicated again as always.
I have a sheet that I am entering data into cells B:B
I have an event macro set up to auto time and date in adjacent cells A:A
I would like C:C to calculate the difference between cell b5-b4, b6-b5,
b7-b6 etc. etc.
=IF(ISBLANK(B3),"",B3-B2)
The results in C:C will be both + and - values.
I want to run a condition that will colour the cells defined by either plus
or minus values with the code below.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("b:b")) Is Nothing Then Exit Sub
Select Case Target.Column
Case Is = Me.Range("b1").Column
With Target
If .Row = 1 Then
'do nothing
Else
If IsEmpty(.Cells) Then
'do nothing
Else
'don't fire again!
Application.EnableEvents = False
With .Offset(0, -1)
.NumberFormat = "dddd - dd mmmm yyyy - hh:mm:ss"
.Value = Now
End With
Application.EnableEvents = True
End If
End If
End With
End Select
End Sub
Any help is appreicated again as always.