Lookup and return multiple results

shanegu01

New Member
Joined
Dec 8, 2019
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi all

I am looking for assistance to create a search function that will search across multiple columns and return those results in a separate worksheet. In the attached sample I have 2 worksheets - one named 'Name_Changes' and the other 'Search_Results'.
The 'Name changes contains the data and 'Search results' should have the output of the search results.

Looking at the attached sample - Column A shows original name and column B shows the name change. The yellow highlighted names contain a history of name changes over time for this particular name. I am wanting to be able to enter a 'key' word that will be used to lookup and return history of name changes for that word. You can see cell E2 has the word we want to search ('smith'). The macro should search column A&B and return the history of the name changes to the word in E2 (smith). I have created an result of this search in the output section in the sample below. You can see how the history is kept together where the name 'Smith company' has had a few changes and ultimately ended with the name ' Smith group'. I want to return the whole history and include the dates contained in column C 'Effective date'. the output of the search results should be pasted into cell A1 in the 'Search_results' worksheet and include the headings of each column.

The blue highlighted names also provides name changes that relate to each other - if I want to search for the word 'Southern or stars or all or more' the output should be the combination of rows 5 & 8.

I do hope this makes sense.


Book1
ABCDEFG
1Current name New name Effective dateSearch database
2Smith companySmith partnership 1/04/2003smith
3Smith partnershipSmith & Co.23/04/2009
4Hero formsAny comp1/07/2012
5Southern Stars All stars25/01/2015
6I'm tired New energy17/04/2016
7Smith & Co.Smith group 11/07/2019
8All stars No more stars25/12/2019Output
9
10Smith companySmith partnership 1/04/2003
11Smith partnershipSmith & Co.23/04/2009
12Smith & Co.Smith group 11/07/2019
13
14
Name_Changes
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi, you only need add a code for every Partner, then every change on this code can be retrieve with this field, in addition if you want, add a datetime field for better performance.
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,185
Members
448,872
Latest member
lcaw

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