search text

Sophearith

New Member
Joined
Sep 16, 2018
Messages
1
Dear Exceller,
I have data in multiple columns say from A-E
I have name in such columns
A B C D E
1 Kane Jack Mona David Roza
2 John Kate Rosa Jinny Mina
3 Saha Sine Hovid Kani Hana
4 Rose Hidy Howdy Hatha Sizy
I want to search word "Kani" in cell A10 and return cell address in B10.in this table the result cell address:D3
hope it helps,need both formula and vba
regards
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Book1
ABCDE
1KaneJackMonaDavidRoza
2JohnKateRosaJinnyMina
3SahaSineHovidKaniHana
4RoseHidyHowdyHathaSizy
5
6
7
8
9
10kaniD3
11
12
Sheet2
Cell Formulas
RangeFormula
B10{=ADDRESS(MIN(IF(ISNUMBER(SEARCH(A10,$A$1:$E$4)),ROW($A$1:$E$4))),MIN(IF(ISNUMBER(SEARCH(A10,$A$1:$E$4)),COLUMN($A$1:$E$4))),4)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
.

Download Workbook : https://www.amazon.com/clouddrive/share/Lemuv6RcLdA4naZpoCyYzPgyEp7iSjmjOYy0jwYcy4f


Code:
Option Explicit


Sub FindInLists()
     '
     '
     '
     
    Dim SheetsToSearch, SrchStrg As String, ws As Excel.Worksheet, r As Range
     Set ws = Sheets("Sheet1")
    SrchStrg = Application.InputBox("Enter Term to search ", "Search Term", Type:=2)
    
    With ws
        
            With ws.Range("A2:AB5000")  'EDIT RANGE AS REQUIRED
                Set r = .Find(what:=SrchStrg, After:=.Range("A1"))   'find the cell whose value is equal to SrchStrg and activate it
                If Not r Is Nothing Then
                    ws.Activate: r.Activate
                    ws.Range("B1").Value = SrchStrg
                    ws.Range("D1").Value = ActiveCell.Address
                                       
                ElseIf r Is Nothing Then
                    MsgBox "Search term does not exist. ", vbInformation, "Item Not Found"
                End If
            End With
        
    End With
     
End Sub




A
B
C
D
E
F
1
Search Term :
Sally​
Location :
$A$18​
2
3
4
5
6
7
1​
8
9
10
11
12
Timothy
13
14
15
16
17
18
Sally
19
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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