Excel VBA to extract 2 or 3 keywords left and right from cell content

satish78

Board Regular
Joined
Aug 31, 2014
Messages
178
Hi Friends,


Trying to extract 2 or 3 keywords from cell content through excel vba.
Sheet1 ColumnA has rows with content sample file attached.
I need vba to search for keywords from sheet2 ColumnA in Sheet1 and extract 2 or 3 or 4 keywords from each row content into sheet3.(Popup box would be better to enter number of keywords to extrat each time when I run the macro)


sheet2 contacts keywords with space on right and left.
Please take a look in sample file attached.


https://spaces.hightail.com/space/f8TKHGTtPY


Satish
 

Leith Ross

Well-known Member
Joined
Mar 17, 2008
Messages
1,869
Office Version
2010, 2007
Platform
Windows
Hello Satish,

What would the output on Sheet3 look like? You did not include examples in your workbook.
 

Leith Ross

Well-known Member
Joined
Mar 17, 2008
Messages
1,869
Office Version
2010, 2007
Platform
Windows
Hello Satish,

Thanks for the updated workbook. I see that each column on Sheet3 is used for a single keyword match from Sheet2.

Do you want all matches for a particular keyword in row listed or only the first match found?

Extracting a single word from the left of the keyword and to the right of it is easy. Ignoring punctuation and articles like (a, an, the) is not difficult. However matches like "
Subject Matter Expert in logistics" become more difficult than simply "Expert in logistics". To handle matches like these would require an list of acceptable combinations of words used with "Expert" or their abbreviations like "SME in Logistics".
 

satish78

Board Regular
Joined
Aug 31, 2014
Messages
178
I want all matches extracted.
Expert in logistics would be fine. Because the word Expert it self defines Expect in logistics.
 

Forum statistics

Threads
1,081,982
Messages
5,362,543
Members
400,679
Latest member
alecalec202

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top