Try something like
![]()
Private Sub TextBoxDOB_AfterUpdate() Dim x, ii As Long, TB With Sheets("data").[c3].CurrentRegion x = .Parent.Evaluate("match(""" & Me.TextBoxMin & """&""" & Me.TextBoxDOB & _ """," & .Columns(1).Address & "&" & .Columns(2).Address & ",0)") If IsNumeric(x) Then TB = Array("name", "ch", "cp", "ss", "date") For ii = 0 To UBound(TB) Me("textbox" & TB(ii)) = .Cells(x, ii + 3).Text Next Else MsgBox "Invalid Entry" End If End With End Sub
Bookmarks