Trying to do this: If anything in column D, then put period in column E.
ALSO
If anything in column A or B, then put the current date in column I. (code below for this)
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A5:A2000"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 8).ClearContents
Else
With .Offset(0, 8)
.NumberFormat = "dd-mmm-yy"
.Value = Date
End With
End If
Application.EnableEvents = True
End If
If Not Intersect(Range("b5:b2000"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 7).ClearContents
Else
With .Offset(0, 7)
.NumberFormat = "dd-mmm-yy"
.Value = Date
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
When I use the above together with the below... they clash. Any way around this?
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
On Error Resume Next
If Not Intersect(Target, Range("D:D")) Is Nothing Then
Application.EnableEvents = False
If Activecell <> "" Then
Activecell.Offset(, 1) = "."
Else
Activecell.Offset(, 1) = ""
End If
Application.EnableEvents = True
End If
End Sub
Bookmarks