excel search

kamal007

New Member
Joined
Jan 1, 2017
Messages
3
I want to do an excel search of a line has several value, so i will want when i type the value of this line (complet value ) he send me or else tell me the number of that line or ...
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Use the following formula:
=MATCH(B2,A:A,0)
Here B2 is the value you are searching in Column A
 
Upvote 0
I want to do an excel search of a line has several value, so i will want when i type the value of this line (complet value ) he send me or else tell me the number of that line or ...

Not sure what you mean by send me, but I think basically you are looking for Worksheet_Change event code. Assume your entry cell is B2.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim fn As Range
    If Not Intersect(Target, Range("B2")) Is Nothing Then
        Set fn = ActiveSheet.UsedRange.Find(Target.Value, Range("B2"), xlValues)
            If Not fn Is Nothing Then
                fn.Select
            Else
                MsgBox "No Matches Found"
            End If
    End If
End Sub
To use this code, right click the name tab of the sheet where you want to search for values. Click 'View Code' in the pop-up menu and paste the code into the large code pane. Close the VB editor window and save the workbook as a macro enabled workbook, if not alread so. Be sure you are not in design mode before attempting to execute the macro. The design mode icon is the triangle with ruler and pencil. If the icon is highlighted, click on it to exit design mode. You might have to re-open the VB editor (Alt + F11) to find the icon. if you are not in design mode, the macro should run when you make a change to cell B2. You can change you input cell to whatever you like, but be sure you also change the code in the two place where "B2" appears to match whatever you change to.
 
Upvote 0
viewer.php
[/URL][/IMG]
I want tap 7 8 9 6 5, and he gives me NAME 1
or 2 6 5 3 4 he gives me NAME 2
and thank you,
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

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