Hi Joshua,
Try this event macro:
Private Sub Worksheet_Change(ByVal Target As Range)
'//Macro written by Trebor76//
If Target.Address = "$A$1" Then
'If the cell has been cleared, then...
If Len(Range("A1")) = 0 Then
'...do nothing.
Exit Sub
End If
Dim rngFoundCell As Range, _
rngMySearchRange As Range
Dim varMySearchValue As Variant
varMySearchValue = Range("A1").Value
Set rngMySearchRange = Range("A4:A" & Range("A" & Rows.Count).End(xlUp).Row)
Set rngFoundCell = rngMySearchRange.Find(What:=varMySearchValue, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False)
'If the 'rngFoundCell' variable has been set, then...
If Not rngFoundCell Is Nothing Then
'...put a 'x' in the 'rngFoundCell' row of Column E.
Range("E" & rngFoundCell.Row).Value = "x"
Range("A1").Select
'Else...
Else
'...inform the user that no match was found.
MsgBox "There was no match for " & """" & varMySearchValue & """" & " in sheet """ & ActiveSheet.Name & """ for the set range of " & rngMySearchRange.Address & ".", vbExclamation, "My Search Editor"
End If
End If
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("E4:E3000"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
Regards,
Robert
Bookmarks