Returning Text Templates with Keywords

rorymacaskill1

New Member
Joined
Mar 13, 2017
Messages
6
Hi everyone,

We create a lot of letters for clients and often find ourselves writing out much the same thing from scratch. I'm looking for a way to paste the text from the letters I write into a database spreadsheet, let's say column A, and characterise them with, say, up to 10 relevant keywords in column B, let's say "high-turnover" "retail" "marketing" (ideally with a Description and Category column for completeness). Then, when I am next writing a letter for a high-turnover retail client about marketing I would like to be able to type these same keywords into a retrieval function in separate sheet and have the template database searched for the letter template most relevant to those keywords, where it could readily be copied and pasted into a letter. Of course, over time it is likely that I will end up with more than one template matching a given set of keywords, and similarly I may make searches for more keywords than I have assigned to any one individual template. In these circumstances I'd look for a list of multiple templates to be returned in order of the largest number of keywords matched, from which I could manually choose the most appropriate. I'd also like to be able to stipulate that a given keyword must be matched.

Database:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Description[/TD]
[TD]Category[/TD]
[TD]Keywords[/TD]
[TD]Letter Text[/TD]
[/TR]
[TR]
[TD]Introduction[/TD]
[TD]Salutations[/TD]
[TD]welcome, hello, [/TD]
[TD]I'm letter template A[/TD]
[/TR]
[TR]
[TD]Dogs vs Cats[/TD]
[TD]Choices[/TD]
[TD]dogs, cats, comparison, choice[/TD]
[TD]I'm letter template B[/TD]
[/TR]
[TR]
[TD]Dogs[/TD]
[TD]Information[/TD]
[TD]dogs, feeding, walking, grooming, breeding[/TD]
[TD]I'm letter template C[/TD]
[/TR]
[TR]
[TD]Cats[/TD]
[TD]Information[/TD]
[TD]cats, feeding, breeding, care, temperament[/TD]
[TD]I'm letter template D[/TD]
[/TR]
</tbody>[/TABLE]

Keyword Search:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Keywords:[/TD]
[TD]dogs, feeding, breeding
[/TD]
[/TR]
</tbody>[/TABLE]

Best Matches:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Keywords Matched:[/TD]
[TD]Description[/TD]
[TD]Category[/TD]
[TD]Keywords[/TD]
[TD]Letter Text[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Dogs[/TD]
[TD]Information[/TD]
[TD]dogs, feeding, walking, grooming, breeding[/TD]
[TD]I'm letter template C[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Cats[/TD]
[TD]Information[/TD]
[TD]cats, feeding, breeding, care, temperament[/TD]
[TD]I'm letter template D[/TD]
[/TR]
</tbody>[/TABLE]


I hope that comes across clearly enough... does anyone have any ideas how it could work? I'm fairly Excel literate but have never attempted anything like this. Keen to try and keep it to Excel + VBA for the ease of use and distribution.

I appreciate everyone's contributions!

Many thanks.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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