Results 1 to 16 of 16

Excel VBA Code to find two words near each other (proximity search)

Threaded View

  1. #1
    Registered User
    Join Date
    01-13-2020
    Location
    CA
    MS-Off Ver
    2016
    Posts
    24

    Excel VBA Code to find two words near each other (proximity search)

    Hello -

    I am having a difficulty coming up with a macro that would do all of the following:
    1. Search a column of texts where two words are near each other regardless of order (e.g., within 5 words of each other)
    2. Highlight those cells
    3. Variations of the same word (e.g., charge, charges, charged, charging) needs to be taken into account

    I am relatively new to using VBA, so I appreciate any help or insight!

    Example: I want to find and highlight the cells in a column where the word "incorrect" is within 3 words of "bill"
    1. The vendor billed the company incorrectly. -> this cell would be highlighted
    2. The vendor sent an incorrect bill to the company. -> this cell would be highlighted
    3. The vendor did not send a bill to the company. -> this cell would not be highlighted

    I was thinking to use Regular Expression. Any thoughts?
    Last edited by demiwen12; 01-13-2020 at 09:54 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 18
    Last Post: 05-15-2018, 05:17 AM
  2. [SOLVED] Vba code to search key words in descriptions column
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2017, 02:37 AM
  3. [SOLVED] Macro to search for specific words in proximity to each other?
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2014, 11:55 AM
  4. Setting up a search macro to find multiple words
    By O0J0E in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-19-2013, 05:14 AM
  5. Want an VB code to search / replace words in another macro
    By CatEnters in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2012, 07:49 PM
  6. [SOLVED] Search Cells for key words and add category code
    By Jimbo42 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-07-2012, 05:23 PM
  7. Replies: 1
    Last Post: 04-04-2012, 07:15 PM

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