+ Reply to Thread
Results 1 to 9 of 9

Key word alert from sentences plus addendum

  1. #1
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Key word alert from sentences plus addendum

    On sheet 1 column D, I have a list of short sentences that describe the trip a horse had. If there is a key word in that sentence that shows the horse had trouble, I would like to put a “C” in column E to denote that as shown on Sheet 2. But I don’t want it on sheet 2, I want it in the same sheet (sheet1). Sheet 2 is for demonstration purposes only.

    There are certain key words that would be significant to denote the trouble such as the word “steadied” or “jostled” etc. Those words are also sometimes abbreviated. So I would like the macro to refer to a mini list of words that can be added to that would trigger the “C” notation. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Key word alert from sentences plus addendum

    For this to happen, you will need to provide a listing of words and abbreviations that you wish to have identified. We are not mind readers nor horse afficianados that will know what words/abbreviations you wish to have flagged.

    Additionally, please update your profile to identify which version of Excel you are using and your general location. Both of these items are important to knowing what will and will not work in your version of Excel.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Key word alert from sentences plus addendum

    Hi light,

    Here is your answer. I needed to find a good website to find an answer at: https://exceljet.net/formula/cell-co...of-many-things
    Find your file attached where I used a Dynamic Named Range of Problems on Sheet1 and a formula down a column to show your "C" or not. If you add any word to the ProblemList on Sheet1 (look in the Data Tab > Names Manager for the DNR) it should do what you requested.
    Search using DNR List IsNumber SumProduct.xlsx

    Edit:
    You need to put this formula in E1 and pull it all the way down,
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by MarvinP; 04-04-2020 at 03:56 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: Key word alert from sentences plus addendum

    Adding key words to a list in a macro is easy. You could use a "case" for that. I am having difficulty getting the macro to recognize a key word in the sentence.

  5. #5
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: Key word alert from sentences plus addendum

    Thanks MarvinP. I was looking for a macro but this is definitely useful.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Key word alert from sentences plus addendum

    To find a word in a sentence, use the Instr function within Visual Basic.

  7. #7
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: Key word alert from sentences plus addendum

    I found the macro I needed here. Scroll down about halfway to see the example.

    https://techcommunity.microsoft.com/...ds/m-p/205218#

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Key word alert from sentences plus addendum

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Key word alert from sentences plus addendum

    Hey light,

    After writing a lot of VBA code, I still the non-code answer better and here is why. If you shift your data by a few cells, your macro may no longer work. Why Because unless you are very careful with VBA code it is hard coded to places on your worksheet. I can't tell you how many apps I've written Excel where the end user wants to insert a column (or two) or move the lookup table to another sheet. When they do that the code breaks. If you use what I supplied above and insert columns, Excel knows and adjusts. Just my 2 cents.

    Glad you got an answer you wanted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Marco to highlight any sentences in the word doc that are present in an excel spreadsheet
    By breadncheesetheking in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2019, 09:32 PM
  2. [SOLVED] Count every word within sentences for all instances
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 02-18-2016, 09:26 AM
  3. filter by word i sentences which contains JOB
    By Baskar5353 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2015, 11:18 AM
  4. finding one word from a list of cell that contain multiple sentences
    By maulik1k in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-28-2014, 06:54 PM
  5. Find a requested word within sentences and output those sentences elsewhere
    By swfred2000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2014, 02:24 PM
  6. [SOLVED] Count word found in column of sentences
    By [email protected] in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-17-2014, 08:27 AM
  7. Upper only first character in first word of sentences
    By cuongvt in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-31-2007, 06:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1