searching data from 1 column in multiple tab

LadyHarper

New Member
Joined
Jun 28, 2017
Messages
48
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon,
on a spreadsheet, in column G, I need a formula that will look at text in column B and search columns A on 4 different tabs.

If it finds a cell that contains the text from column B, then paste that cells contents in column G.

Formula or VBA
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi LadyHarper,

Try the below UDF ... In cell G1, type the following formula =FindMyWord(B1)

VBA Code:
Function FindMyWord(Txt$) As String

Dim ws As Worksheet, Rg As Range

For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) '<-- change sheet names
   Set Rg = ws.Columns(1).Find(Txt, lookat:=xlPart)
   If Not Rg Is Nothing Then
      FindMyWord = Rg.Value
      Exit Function
   End If
Next

End Function
 
Upvote 0
With formula in G1:

=IFERROR(VLOOKUP("*"&B1&"*",Sheet1!A:A,1,0),IFERROR(VLOOKUP("*"&B1&"*",Sheet2!A:A,1,0),
IFERROR(VLOOKUP("*"&B1&"*",Sheet3!A:A,1,0),IFERROR(VLOOKUP("*"&B1&"*",Sheet4!A:A,1,0),"Not Found"))))
 
Upvote 0
Hi LadyHarper,

Try the below UDF ... In cell G1, type the following formula =FindMyWord(B1)

VBA Code:
Function FindMyWord(Txt$) As String

Dim ws As Worksheet, Rg As Range

For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) '<-- change sheet names
   Set Rg = ws.Columns(1).Find(Txt, lookat:=xlPart)
   If Not Rg Is Nothing Then
      FindMyWord = Rg.Value
      Exit Function
   End If
Next

End Function



Hi, This worked. Is there away to have it continually update. So as I make changes in the sheets, can the data in cell G1 update right away?
 
Upvote 0
Hi, This worked. Is there away to have it continually update. So as I make changes in the sheets, can the data in cell G1 update right away?
See if this change does it:
Rich (BB code):
Function FindMyWord(Txt$) As String

Application.Volatile

Dim ws As Worksheet, Rg As Range

For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) '<-- change sheet names
   Set Rg = ws.Columns(1).Find(Txt, lookat:=xlPart)
   If Not Rg Is Nothing Then
      FindMyWord = Rg.Value
      Exit Function
   End If
Next

End Function
 
Upvote 0
See if this change does it:
Rich (BB code):
Function FindMyWord(Txt$) As String

Application.Volatile

Dim ws As Worksheet, Rg As Range

For Each ws In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) '<-- change sheet names
   Set Rg = ws.Columns(1).Find(Txt, lookat:=xlPart)
   If Not Rg Is Nothing Then
      FindMyWord = Rg.Value
      Exit Function
   End If
Next

End Function


This does not update it if a change is made.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

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