Given a text string located in Cell R11, I need to search for that text string in a named range, get the address of the location of string, then set the time and date to a cell two columns to the right of the cell found in the search, and lastly select the cell that was written to so the user sees the value has been written. Below is what I have so far. However, no matter the entry in R11 the data/time is always being written to the second item in the range 2 columns over.
Private Sub BtnEnter_Click()
Dim rRng As Range
Dim rStartCell As Range
Dim strFindText As String
strFindText = ThisWorkbook.Sheets("Participants").Range("R11").Text
Set rRng = Range("Bib")
Set rStartCell = rRng.Find(What:=strFindText)
If Not rStartCell Is Nothing Then
rStartCell.Offset(ColumnOffset:=2).Value = Date + Time
Else
MsgBox Title:="No Match", _
Prompt:="Search item was not found.", _
Buttons:=vbOKOnly
End If
End Sub
Bookmarks