+ Reply to Thread
Results 1 to 7 of 7

Macro to find exact phrase

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Macro to find exact phrase

    I have the below which deletes all rows above if it finds the string anywhere in a cell. I want to alter it so that it only does this if it finds the EXACT word in the cell.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro to find exact phrase

    Hi,

    Change this line to :

    Please Login or Register  to view this content.
    Change the text "ExactWord" with the word you want to find.

    Regards
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro to find exact phrase

    Highlights what you added and says Named Argument Not Found...

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro to find exact phrase

    Sorry, a typo, it should be :

    Please Login or Register  to view this content.
    Regards

  5. #5
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Macro to find exact phrase

    As posted by karedog you need xlWhole and if your question mark is a string i.e. you aren't using it as a wildcard (can't tell by your question) then you need to put a space after the ?
    i.e.
    Please Login or Register  to view this content.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  6. #6
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Macro to find exact phrase

    solved. thanks guys.

  7. #7
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro to find exact phrase

    You are welcome, glad I can help.

    @WasWodge : Nice tip, nice avatar too

+ 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. Macro for seaching a phrase and add 7 rows after that phrase
    By yhyhyhyh in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-10-2014, 11:52 PM
  2. Replies: 0
    Last Post: 09-26-2012, 02:02 PM
  3. Conditional Formating for EXACT word or phrase
    By elfvis in forum Excel General
    Replies: 6
    Last Post: 11-17-2011, 03:31 PM
  4. Assist in modifying code to locate an exact phrase in a cell
    By Jsin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-09-2010, 02:52 PM
  5. Extracting an exact phrase from a Cell
    By mazalam in forum Excel General
    Replies: 5
    Last Post: 09-01-2005, 04:05 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