search and display names

HeRoseInThree

Board Regular
Joined
Jan 11, 2018
Messages
103
My company hires few people, yet many apply. That being said, I would like to sort through the list of applicants to determine if they have previously applied as to not waste time on someone that we have chosen not to hire.

I'd like to search their name in a cell (k12) and have it display a cell is the reason we passed.

I have tried a vlookup formula, an index formula as well as find and search respectfully.

Any help would be greatly appreciated!
 
Try this

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.Count > 1 Then Exit Sub
  If Target.Address(0, 0) = "H1" Then
    Range("H2:J" & Rows.Count).ClearContents
    If Target.Value = "" Then Exit Sub
    Dim a() As Variant, b As Variant, i As Long, n As Long
    a = Range("A1:C" & Range("B" & Rows.Count).End(xlUp).Row).Value
    ReDim b(1 To UBound(a, 1), 1 To 3)
    n = 1
    For i = 1 To UBound(a)
      If InStr(1, LCase(a(i, 2)), LCase(Target.Value)) > 0 Then
        b(n, 1) = a(i, 1)
        b(n, 2) = a(i, 2)
        b(n, 3) = a(i, 3)
        n = n + 1
      End If
    Next
    Range("H2").Resize(UBound(b), 3).Value = b
  End If
End Sub
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
varios 17mar2020.xlsm
ABCDEFGHIJ
1DATENAMETEXTdam
201-marjo105/03/2020dam5
302-marjo206/03/2020dam6
403-marjo307/03/2020dam7
504-marjo408/03/2020dam8
605-mardam5
706-mardam6
807-mardam7
908-mardam8
1009-mardan9
1110-mardan10
1211-mardan11
Hoja4



With that data sample it works.
You write the name in H1 and the data is copied to H2, I2, J2 and down.

You can put your data sample here and also tell what data you are putting in cell H1.

Lastly, did you modify any of the macro?
Did you copy the complete macro?
 
Upvote 0
I did not modify and I did copy the complete information.


1584473670829.png


the date doesn't show up.
1584473613772.png
 
Upvote 0
You can put the macro you are using here.
Your images are not complete, I do not see the excel rows.
You could try with the data that I am putting of sample.
 
Upvote 0
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address(0, 0) = "H1" Then
Range("H2:J" & Rows.Count).ClearContents
If Target.Value = "" Then Exit Sub
Dim a() As Variant, b As Variant, i As Long, n As Long
a = Range("A1:C" & Range("B" & Rows.Count).End(xlUp).Row).Value
ReDim b(1 To UBound(a, 1), 1 To 3)
n = 1
For i = 1 To UBound(a)
If InStr(1, LCase(a(i, 2)), LCase(Target.Value)) > 0 Then
b(n, 1) = a(i, 1)
b(n, 2) = a(i, 2)
b(n, 3) = a(i, 3)
n = n + 1
End If
Next
Range("H2").Resize(UBound(b), 3).Value = b
End If
End Sub
 
Upvote 0
You replaced the old macro with this new one.
You put the new macro in the sheet events where you want this to happen.
In fact, first delete the old macro and make sure to put the new macro in.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top